summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Irc/IrcPlugin.php4
-rw-r--r--plugins/Irc/README2
-rw-r--r--plugins/Irc/ircmanager.php4
3 files changed, 8 insertions, 2 deletions
diff --git a/plugins/Irc/IrcPlugin.php b/plugins/Irc/IrcPlugin.php
index e073d6f13..c555580c3 100644
--- a/plugins/Irc/IrcPlugin.php
+++ b/plugins/Irc/IrcPlugin.php
@@ -60,6 +60,7 @@ class IrcPlugin extends ImPlugin {
public $channels = null;
public $transporttype = null;
public $encoding = null;
+ public $pinginterval = null;
public $regcheck = null;
public $unregregexp = null;
@@ -359,6 +360,9 @@ class IrcPlugin extends ImPlugin {
if (!isset($this->encoding)) {
$this->encoding = 'UTF-8';
}
+ if (!isset($this->pinginterval)) {
+ $this->pinginterval = 120;
+ }
if (!isset($this->regcheck)) {
$this->regcheck = true;
diff --git a/plugins/Irc/README b/plugins/Irc/README
index bc45688f1..0a5d9ea83 100644
--- a/plugins/Irc/README
+++ b/plugins/Irc/README
@@ -23,6 +23,8 @@ nickservidentifyregexp: Override existing regexp matching request for identifica
channels: Channels for bot to idle in
transporttype: Set to 'ssl' to enable SSL
encoding: Set to change encoding
+pinginterval: Set to change the number of seconds between pings (helps keep the connection open)
+ Defaults to 120 seconds
regcheck: Check user's nicknames are registered, enabled by default, set to false to disable
regregexp: Override existing regexp matching response from NickServ if nick checked is registered.
Must contain a capturing group catching the nick
diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php
index 5c8e09e35..f036ef309 100644
--- a/plugins/Irc/ircmanager.php
+++ b/plugins/Irc/ircmanager.php
@@ -78,7 +78,7 @@ class IrcManager extends ImManager {
if ($this->messageWaiting) {
return 1;
} else {
- return 120;
+ return $this->plugin->pinginterval;
}
}
@@ -89,7 +89,7 @@ class IrcManager extends ImManager {
*/
public function idle() {
// Send a ping if necessary
- if (empty($this->lastPing) || time() - $this->lastPing > 120) {
+ if (empty($this->lastPing) || time() - $this->lastPing > $this->plugin->pinginterval) {
$this->sendPing();
}