/[drupal]/contributions/modules/xmpp_server/xmpp_server.module
ViewVC logotype

Diff of /contributions/modules/xmpp_server/xmpp_server.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6, Fri Sep 26 00:45:41 2008 UTC revision 1.7, Fri Sep 26 02:45:29 2008 UTC
# Line 49  function xmpp_server_requirements() { Line 49  function xmpp_server_requirements() {
49    $requirements['xmpp_server'] = array(    $requirements['xmpp_server'] = array(
50      'title' => t('XMPP Server'),      'title' => t('XMPP Server'),
51    );    );
52    //Give the server an extra 30 seconds for latency, just to be safe.    //Check the server's ping, but give it an extra five seconds just in case.
53    if (variable_get('xmpp_server_ping', 0) > time() - 10) {    if (variable_get('xmpp_server_ping', 0) > time() - variable_get('xmpp_server_ping_frequency', 15) - 5) {
54      $requirements['xmpp_server']['description'] = t('XMPP Server is online and functioning.');      $requirements['xmpp_server']['description'] = t('XMPP Server is online and functioning.');
55      $requirements['xmpp_server']['severity'] = REQUIREMENT_OK;      $requirements['xmpp_server']['severity'] = REQUIREMENT_OK;
56    }    }
57    else {    else {
58      $requirements['xmpp_server']['description'] = t('XMPP Server is offline or is not responding.');      $requirements['xmpp_server']['description'] = t('XMPP Server is offline or is not responding. (If you just started it, it may take up to @secs seconds for this value to update.', array('@secs' => variable_get('xmpp_server_ping_frequency', 15)));
59      $requirements['xmpp_server']['severity'] = REQUIREMENT_WARNING;      $requirements['xmpp_server']['severity'] = REQUIREMENT_WARNING;
60    }    }
61    
# Line 79  function xmpp_server_xmpp_server_start() Line 79  function xmpp_server_xmpp_server_start()
79    
80    //Start our sockets listening.    //Start our sockets listening.
81    xmpp_server_start_sockets();    xmpp_server_start_sockets();
82    
83      //Refresh Drupal variables every 15 seconds.
84      xmpp_server_new_timer(15, '_xmpp_server_variables_refresh');
85    
86    echo t("XMPP Server is now running for site @url", array('@url' => url('', array('absolute' => TRUE)))) . "\n";    echo t("XMPP Server is now running for site @url", array('@url' => url('', array('absolute' => TRUE)))) . "\n";
87  }  }
88    
89    function _xmpp_server_variables_refresh() {
90      global $conf;
91      $conf = variable_init();
92      variable_set('xmpp_server_ping', time());
93      return variable_get('xmpp_server_ping_frequency', 15);
94    }
95    
96  /**  /**
97   * This is our main loop, which is called once per second from xmppd.php   * This is our main loop, which is called once per second from xmppd.php
98   */   */

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.2