]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
- Corrected PhotoSticker bug in phpmsnclass
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Sun, 13 Jun 2010 02:42:21 +0000 (03:42 +0100)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Sun, 13 Jun 2010 02:42:21 +0000 (03:42 +0100)
 - Update time till next ping when a command is sent

plugins/Msn/extlib/phpmsnclass/msn.class.php
plugins/Msn/msnmanager.php

index 65525fe5565893384c522a4e891b37694cc23452..ef4f45b44158ecec174c82c0605b9a879b7f21de 100644 (file)
@@ -180,7 +180,7 @@ class MSN {
         $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
@@ -3626,15 +3626,8 @@ X-OIM-Sequence-Num: 1
         \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
@@ -3651,6 +3644,10 @@ X-OIM-Sequence-Num: 1
         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
index 99ac2191574035c5c983d3903552007c5c71ee91..1ef496f56f39219f73e4a83753e7afdeca1920b0 100644 (file)
@@ -139,6 +139,10 @@ class MsnManager extends ImManager
             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;
     }
 }