summaryrefslogtreecommitdiff
path: root/scripts/xmppconfirmhandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/xmppconfirmhandler.php')
-rwxr-xr-xscripts/xmppconfirmhandler.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index e863f3e7e..3c31c5d8b 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -63,7 +63,10 @@ class XmppConfirmHandler {
$this->conn->presence(NULL, 'available', NULL, 'available', -1);
}
- function handle_queue() {
+ function run() {
+ if (!$this->start()) {
+ return false;
+ }
$this->log(LOG_INFO, 'checking for queued confirmations');
do {
$confirm = $this->next_confirm();
@@ -99,6 +102,10 @@ class XmppConfirmHandler {
$this->idle(10);
}
} while (true);
+ if (!$this->finish()) {
+ return false;
+ }
+ return true;
}
function next_confirm() {
@@ -181,8 +188,5 @@ $resource = ($argc > 1) ? $argv[1] : (common_config('xmpp', 'resource').'-confir
$handler = new XmppConfirmHandler($resource);
-if ($handler->start()) {
- $handler->handle_queue();
-}
+$handler->runOnce();
-$handler->finish();