From abf3cadc480ed88830a819a57fba0418f84e0e55 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 12 Oct 2003 20:38:37 +0000 Subject: [PATCH] Add jabber port, ignore queue lock if older than queue_interval ... probably means it didn't complete (this queue business may cause us problems ...) git-svn-id: file:///svn/phpbb/trunk@4591 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 8 +++++--- phpBB/language/en/lang_admin.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 28cd796507..f2819f91be 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -336,6 +336,7 @@ class messenger $this->jabber = new Jabber; $this->jabber->server = $config['jab_host']; + $this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222; $this->jabber->username = $config['jab_username']; $this->jabber->password = $config['jab_password']; $this->jabber->resource = (!empty($config['jab_resource'])) ? htmlentities($config['jab_resource']) : ''; @@ -358,7 +359,7 @@ class messenger $this->jabber->SendMessage($address, 'normal', NULL, array('body' => $msg)); } - $this->jabber->CruiseControl(2); + sleep(1); $this->jabber->Disconnect(); } else @@ -409,7 +410,7 @@ class queue set_config('last_queue_run', time()); - if (!file_exists($this->cache_file) || file_exists($this->cache_file . '.lock')) + if (!file_exists($this->cache_file) || (file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval'])) { return; } @@ -449,6 +450,7 @@ class queue $this->jabber = new Jabber; $this->jabber->server = $config['jab_host']; + $this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222; $this->jabber->username = $config['jab_username']; $this->jabber->password = $config['jab_password']; $this->jabber->resource = (!empty($config['jab_resource'])) ? htmlentities($config['jab_resource']) : ''; @@ -515,7 +517,7 @@ class queue case 'jabber': // Hang about a couple of secs to ensure the messages are // handled, then disconnect - $this->jabber->CruiseControl(2); + sleep(1); $this->jabber->Disconnect(); break; } diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index d38e62ae36..6e3f53a2c2 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -521,6 +521,7 @@ $lang += array( 'JAB_SERVER' => 'Jabber server', 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers', 'JAB_PORT' => 'Jabber port', + 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 5222', 'JAB_USERNAME' => 'Jabber username', 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', 'JAB_PASSWORD' => 'Jabber password',