diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-09-01 21:26:04 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-09-01 21:26:04 -0400 |
commit | c6c3cd40f6304b49f5d4841e9999641a183e987b (patch) | |
tree | 677e174fae15399a510ab7ed65bfd4148b8f0f11 /scripts | |
parent | c31afa795f7077a8d007e0a426cd0910980e1ee5 (diff) |
separate out presence from connection, send different presence types from queuehandlers
darcs-hash:20080902012604-84dde-073a583da9b09c80e5e9a47a5eddd144fad8e87a.gz
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/publicqueuehandler.php | 7 | ||||
-rwxr-xr-x | scripts/xmppconfirmhandler.php | 7 | ||||
-rwxr-xr-x | scripts/xmppdaemon.php | 4 | ||||
-rwxr-xr-x | scripts/xmppqueuehandler.php | 7 |
4 files changed, 18 insertions, 7 deletions
diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index bbb95f1fc..4ebe8187a 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -42,8 +42,11 @@ class PublicQueueHandler extends QueueHandler { function start() { $this->log(LOG_INFO, "INITIALIZE"); # Low priority; we don't want to receive messages - $this->conn = jabber_connect($this->_id, NULL, -1); - $this->conn->addEventHandler('message', 'forward_message', $this); + $this->conn = jabber_connect($this->_id); + if ($this->conn) { + $this->conn->addEventHandler('message', 'forward_message', $this); + jabber_send_presence("Send me a message to post an notice", 'dnd', NULL, 'available', -1); + } return !is_null($this->conn); } diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index ff166485d..1a1c55001 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -48,8 +48,11 @@ class XmppConfirmHandler { function start() { # Low priority; we don't want to receive messages $this->log(LOG_INFO, "INITIALIZE"); - $this->conn = jabber_connect($this->_id, NULL, -1); - $this->conn->addEventHandler('message', 'forward_message', $this); + $this->conn = jabber_connect($this->_id); + if ($this->conn) { + $this->conn->addEventHandler('message', 'forward_message', $this); + jabber_send_presence("Send me a message to post an notice", 'dnd', NULL, 'available', -1); + } return !is_null($this->conn); } diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 37d638b02..03cadee7c 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -61,12 +61,14 @@ class XMPPDaemon { $this->log(LOG_INFO, "Connecting to $connect_to on port $this->port"); - $this->conn = jabber_connect($this->resource, "Send me a message to post a notice", 100); + $this->conn = jabber_connect($this->resource); if (!$this->conn) { return false; } + jabber_send_presence("Send me a message to post a notice", 'available', + NULL, 'available', 100); return !$this->conn->isDisconnected(); } diff --git a/scripts/xmppqueuehandler.php b/scripts/xmppqueuehandler.php index 8e86fe9bb..0b62670bc 100755 --- a/scripts/xmppqueuehandler.php +++ b/scripts/xmppqueuehandler.php @@ -44,8 +44,11 @@ class XmppQueueHandler extends QueueHandler { function start() { $this->log(LOG_INFO, "INITIALIZE"); # Low priority; we don't want to receive messages - $this->conn = jabber_connect($this->_id, NULL, -1); - $this->conn->addEventHandler('message', 'forward_message', $this); + $this->conn = jabber_connect($this->_id); + if ($this->conn) { + $this->conn->addEventHandler('message', 'forward_message', $this); + jabber_send_presence("Send me a message to post an notice", 'dnd', NULL, 'available', -1); + } return !is_null($this->conn); } |