$this->retry_wait = isset($Configs['retry_wait']) ? $Configs['retry_wait'] : 30;\r
$this->backup_file = isset($Configs['backup_file']) ? $Configs['backup_file'] : true;\r
$this->update_pending = isset($Configs['update_pending']) ? $Configs['update_pending'] : true;\r
- $this->PhotoStickerFile=$Configs['PhotoSticker'];\r
+ $this->PhotoStickerFile=isset($Configs['PhotoSticker']) ? $Configs['PhotoSticker'] : false;\r
$this->IgnoreList=isset($Configs['IgnoreList'])?$Configs['IgnoreList']:false;\r
if($this->Emotions = isset($Configs['Emotions']) ? $Configs['Emotions']:false)\r
{\r
\r
$this->SB_writedata($aMessage);\r
\r
- if (feof($this->SBFp))\r
- {\r
- // lost connection? error? try OIM later\r
- @fclose($this->SBFp);\r
- //TODO introduce callback to add offline message to queue?\r
- return false;\r
- }\r
- $this->SB_writeln("OUT");\r
- @fclose($this->SBFp);\r
+ // Don't close the SB session, we might as well leave it open\r
+ \r
return true;\r
}\r
\r
return true;\r
}\r
\r
+ private function getSBSession($to) {\r
+ \r
+ }\r
+ \r
public function sendMessage($message, $to) {\r
if($message != '') {\r
list($name,$host,$network)=explode('@',$to);\r
return false;
}
$this->conn->sflapSend($data[0],$data[1],$data[2],$data[3]);
+
+ // Sending a command updates the time till next ping
+ $this->lastping = time();
+ $this->pingInterval = 50;
return true;
}
}