]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use correct array index access for switchBoardSessions in sendMessageToSBSession
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 16 Jun 2010 01:28:13 +0000 (02:28 +0100)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 16 Jun 2010 01:28:13 +0000 (02:28 +0100)
plugins/Msn/extlib/phpmsnclass/msn.class.php

index c37b945e77b967f309455f9c0592f971c4bd7440..e38c3cc1182e90dbac0b92e699696d15cba7d741 100644 (file)
@@ -1392,7 +1392,6 @@ class MSN {
         $this->switchBoardSessionLookup[$to] = $socket;\r
 \r
         // Store the socket in the sessions array\r
-        $intsocket = (int) $socket;\r
         $this->switchBoardSessions[$to] = array(\r
             'to' => $to,\r
             'socket' => $socket,\r
@@ -1403,6 +1402,7 @@ class MSN {
         );\r
 \r
         // Change the index of the session to the socket\r
+        $intsocket = (int) $socket;\r
         $this->switchBoardSessions[$intsocket] = $this->switchBoardSessions[$to];\r
         unset($this->switchBoardSessions[$to]);\r
 \r
@@ -1457,13 +1457,13 @@ class MSN {
         if (self::socketcheck($socket)) {\r
             return false;\r
         }\r
-\r
-        if (!$this->switchBoardSessions[$to]['joined']) {\r
+        \r
+        $intsocket = (int) $socket;\r
+        if (!$this->switchBoardSessions[$intsocket]['joined']) {\r
             // If our participant has not joined the session yet we can't message them!\r
             return false;\r
         }\r
 \r
-        $intsocket = (int) $socket;\r
         $id = &$this->switchBoardSessions[$intsocket]['id'];\r
 \r
         $aMessage = $this->getMessage($Message);\r