forked from GNUsocial/gnu-social
		
	Add an config option to change the ping interval
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user