a little more robust confirm handler
darcs-hash:20080829182349-84dde-a6d4056d6fa2ecb4c5ed07f3a3a40576315ec4d9.gz
This commit is contained in:
parent
c9782862d4
commit
a0f726fb6c
@ -37,7 +37,7 @@ define('CLAIM_TIMEOUT', 1200);
|
|||||||
|
|
||||||
class XmppConfirmHandler {
|
class XmppConfirmHandler {
|
||||||
|
|
||||||
var $_id = 'generic';
|
var $_id = 'confirm';
|
||||||
|
|
||||||
function XmppConfirmHandler($id=NULL) {
|
function XmppConfirmHandler($id=NULL) {
|
||||||
if ($id) {
|
if ($id) {
|
||||||
@ -45,6 +45,12 @@ class XmppConfirmHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
# Low priority; we don't want to receive messages
|
||||||
|
$this->conn = jabber_connect($this->_id, NULL, -1);
|
||||||
|
return !is_null($this->conn);
|
||||||
|
}
|
||||||
|
|
||||||
function handle_queue() {
|
function handle_queue() {
|
||||||
$this->log(LOG_INFO, 'checking for queued confirmations');
|
$this->log(LOG_INFO, 'checking for queued confirmations');
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
@ -124,7 +130,7 @@ class XmppConfirmHandler {
|
|||||||
|
|
||||||
mb_internal_encoding('UTF-8');
|
mb_internal_encoding('UTF-8');
|
||||||
|
|
||||||
$resource = ($argc > 1) ? $argv[1] : NULL;
|
$resource = ($argc > 1) ? $argv[1] : (common_config('xmpp', 'resource').'-confirm');
|
||||||
|
|
||||||
$handler = new XmppConfirmHandler($resource);
|
$handler = new XmppConfirmHandler($resource);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user