]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Access constants and static methods properly ;)
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 16 Jun 2010 00:30:44 +0000 (01:30 +0100)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 16 Jun 2010 00:30:44 +0000 (01:30 +0100)
plugins/Msn/extlib/phpmsnclass/msn.class.php

index af9a45e49deb35c3a48b54c74ee4da4ffdec081d..5c1a83940b854fbb65ab4f3f8d44a1751286c2c4 100644 (file)
@@ -212,10 +212,10 @@ class MSN {
         // NS: >> VER {id} MSNP9 CVR0\r
         // MSNP15\r
         // NS: >>> VER {id} MSNP15 CVR0\r
-        $this->ns_writeln("VER $this->id ".PROTOCOL.' CVR0');\r
+        $this->ns_writeln("VER $this->id ".self::PROTOCOL.' CVR0');\r
 \r
         $start_tm = time();\r
-        while (!socketcheck($this->NSfp)) {\r
+        while (!self::socketcheck($this->NSfp)) {\r
             $data = $this->ns_readln();\r
             // no data?\r
             if ($data === false) {\r
@@ -238,7 +238,7 @@ class MSN {
                     // MSNP15\r
                     // NS: <<< VER {id} MSNP15 CVR0\r
                     // NS: >>> CVR {id} 0x0409 winnt 5.1 i386 MSMSGS 8.1.0178 msmsgs {user}\r
-                    $this->ns_writeln("CVR $this->id 0x0409 winnt 5.1 i386 MSMSGS ".BUILDVER." msmsgs $user");\r
+                    $this->ns_writeln("CVR $this->id 0x0409 winnt 5.1 i386 MSMSGS ".self::BUILDVER." msmsgs $user");\r
                     break;\r
 \r
                 case 'CVR':\r
@@ -248,7 +248,7 @@ class MSN {
                     // MSNP15\r
                     // NS: <<< CVR {id} {ver_list} {download_serve} ....\r
                     // NS: >>> USR {id} SSO I {user}\r
-                    $this->ns_writeln("USR $this->id ".LOGIN_METHOD." I $user");\r
+                    $this->ns_writeln("USR $this->id ".self::LOGIN_METHOD." I $user");\r
                     break;\r
 \r
                 case 'USR':\r
@@ -281,7 +281,7 @@ class MSN {
                     $login_code = $this->generateLoginBLOB($secret, $nonce);\r
 \r
                     // NS: >>> USR {id} SSO S {ticket} {login_code}\r
-                    $this->ns_writeln("USR $this->id ".LOGIN_METHOD." S $ticket $login_code");\r
+                    $this->ns_writeln("USR $this->id ".self::LOGIN_METHOD." S $ticket $login_code");\r
                     $this->authed = true;\r
                     break;\r
 \r
@@ -307,7 +307,7 @@ class MSN {
                     // NS: >> VER {id} MSNP9 CVR0\r
                     // MSNP15\r
                     // NS: >>> VER {id} MSNP15 CVR0\r
-                    $this->ns_writeln("VER $this->id ".PROTOCOL.' CVR0');\r
+                    $this->ns_writeln("VER $this->id ".self::PROTOCOL.' CVR0');\r
                     break;\r
 \r
                 case 'GCF':\r
@@ -460,7 +460,7 @@ class MSN {
             $len = strlen($str);\r
             $this->ns_writeln("UUX $this->id $len");\r
             $this->ns_writedata($str);\r
-            if (!socketcheck($this->NSfp)) {\r
+            if (!self::socketcheck($this->NSfp)) {\r
                 $this->debug_message('*** Connected, waiting for commands');\r
                 break;\r
             } else {\r
@@ -508,7 +508,7 @@ class MSN {
      */\r
     private function nsReceive() {\r
         // Sign in again if not signed in or socket failed\r
-        if (!is_resource($this->NSfp) || socketcheck($this->NSfp)) {\r
+        if (!is_resource($this->NSfp) || self::socketcheck($this->NSfp)) {\r
             $this->callHandler('Reconnect');\r
             $this->NSRetryWait($this->retry_wait);\r
             $this->signon();\r
@@ -836,7 +836,7 @@ class MSN {
                 $fingerprint = $this->getChallenge($chl_code);\r
                 // NS: >>> QRY {id} {product_id} 32\r
                 // NS: >>> fingerprint\r
-                $this->ns_writeln("QRY $this->id ".PROD_ID.' 32');\r
+                $this->ns_writeln("QRY $this->id ".self::PROD_ID.' 32');\r
                 $this->ns_writedata($fingerprint);\r
                 $this->ns_writeln("CHG $this->id NLN $this->clientid");\r
                 if ($this->PhotoStickerFile !== false)\r
@@ -1433,7 +1433,7 @@ class MSN {
     * @return void\r
     */\r
     private function endSBSession($socket, $killsession = false) {\r
-        if (!socketcheck($socket)) {\r
+        if (!self::socketcheck($socket)) {\r
             $this->sb_writeln($socket, $fake = 0, 'OUT');\r
         }\r
         @fclose($socket);\r
@@ -1455,7 +1455,7 @@ class MSN {
      */\r
     private function sendMessageViaSB($to, $message) {\r
         $socket = $this->switchBoardSessionLookup[$to];\r
-        if (socketcheck($socket)) {\r
+        if (self::socketcheck($socket)) {\r
             return false;\r
         }\r
 \r
@@ -1614,15 +1614,15 @@ class MSN {
 </soap:Envelope>';\r
 \r
         $header_array = array(\r
-            'SOAPAction: '.OIM_MAILDATA_SOAP,\r
+            'SOAPAction: '.self::OIM_MAILDATA_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
-            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.BUILDVER.')'\r
+            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.self::BUILDVER.')'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.OIM_MAILDATA_URL);\r
+        $this->debug_message('*** URL: '.self::OIM_MAILDATA_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, OIM_MAILDATA_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::OIM_MAILDATA_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -1684,15 +1684,15 @@ class MSN {
 </soap:Envelope>';\r
 \r
         $header_array = array(\r
-            'SOAPAction: '.OIM_READ_SOAP,\r
+            'SOAPAction: '.self::OIM_READ_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
-            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.BUILDVER.')'\r
+            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.self::BUILDVER.')'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.OIM_READ_URL);\r
+        $this->debug_message('*** URL: '.self::OIM_READ_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, OIM_READ_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::OIM_READ_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -1760,15 +1760,15 @@ class MSN {
 </soap:Envelope>';\r
 \r
         $header_array = array(\r
-            'SOAPAction: '.OIM_DEL_SOAP,\r
+            'SOAPAction: '.self::OIM_DEL_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
-            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.BUILDVER.')'\r
+            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.self::BUILDVER.')'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.OIM_DEL_URL);\r
+        $this->debug_message('*** URL: '.self::OIM_DEL_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, OIM_DEL_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::OIM_DEL_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -1807,11 +1807,11 @@ class MSN {
         xml:lang="zh-TW"\r
         proxy="MSNMSGR"\r
         xmlns="http://messenger.msn.com/ws/2004/09/oim/"\r
-        msnpVer="'.PROTOCOL.'"\r
-        buildVer="'.BUILDVER.'"/>\r
+        msnpVer="'.self::PROTOCOL.'"\r
+        buildVer="'.self::BUILDVER.'"/>\r
   <To memberName="'.$to.'" xmlns="http://messenger.msn.com/ws/2004/09/oim/"/>\r
   <Ticket passport="'.htmlspecialchars($this->ticket['oim_ticket']).'"\r
-          appid="'.PROD_ID.'"\r
+          appid="'.self::PROD_ID.'"\r
           lockkey="'.$lockkey.'"\r
           xmlns="http://messenger.msn.com/ws/2004/09/oim/"/>\r
   <Sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/rm">\r
@@ -1834,15 +1834,15 @@ X-OIM-Sequence-Num: 1
 </soap:Envelope>';\r
 \r
         $header_array = array(\r
-            'SOAPAction: '.OIM_SEND_SOAP,\r
+            'SOAPAction: '.self::OIM_SEND_SOAP,\r
             'Content-Type: text/xml',\r
-            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.BUILDVER.')'\r
+            'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Messenger '.self::BUILDVER.')'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.OIM_SEND_URL);\r
+        $this->debug_message('*** URL: '.self::OIM_SEND_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, OIM_SEND_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::OIM_SEND_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -2095,15 +2095,15 @@ X-OIM-Sequence-Num: 1
 </soap:Envelope>';\r
 \r
         $header_array = array(\r
-            'SOAPAction: '.DELMEMBER_SOAP,\r
+            'SOAPAction: '.self::DELMEMBER_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
             'User-Agent: MSN Explorer/9.0 (MSN 8.0; TmstmpExt)'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.DELMEMBER_URL);\r
+        $this->debug_message('*** URL: '.self::DELMEMBER_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, DELMEMBER_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::DELMEMBER_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -2232,15 +2232,15 @@ X-OIM-Sequence-Num: 1
 </soap:Body>\r
 </soap:Envelope>';\r
         $header_array = array(\r
-            'SOAPAction: '.ADDMEMBER_SOAP,\r
+            'SOAPAction: '.self::ADDMEMBER_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
             'User-Agent: MSN Explorer/9.0 (MSN 8.0; TmstmpExt)'\r
         );\r
 \r
-        $this->debug_message('*** URL: '.ADDMEMBER_URL);\r
+        $this->debug_message('*** URL: '.self::ADDMEMBER_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, ADDMEMBER_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::ADDMEMBER_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -2310,14 +2310,14 @@ X-OIM-Sequence-Num: 1
 </soap:Body>\r
 </soap:Envelope>';\r
         $header_array = array(\r
-            'SOAPAction: '.MEMBERSHIP_SOAP,\r
+            'SOAPAction: '.self::MEMBERSHIP_SOAP,\r
             'Content-Type: text/xml; charset=utf-8',\r
             'User-Agent: MSN Explorer/9.0 (MSN 8.0; TmstmpExt)'\r
         );\r
-        $this->debug_message('*** URL: '.MEMBERSHIP_URL);\r
+        $this->debug_message('*** URL: '.self::MEMBERSHIP_URL);\r
         $this->debug_message("*** Sending SOAP:\n$XML");\r
         $curl = curl_init();\r
-        curl_setopt($curl, CURLOPT_URL, MEMBERSHIP_URL);\r
+        curl_setopt($curl, CURLOPT_URL, self::MEMBERSHIP_URL);\r
         curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\r
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r
         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\r
@@ -2642,7 +2642,7 @@ X-OIM-Sequence-Num: 1
         // MSNP15\r
         // http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges\r
         // Step 1: The MD5 Hash\r
-        $md5Hash = md5($code.PROD_KEY);\r
+        $md5Hash = md5($code.self::PROD_KEY);\r
         $aMD5 = @explode("\0", chunk_split($md5Hash, 8, "\0"));\r
         for ($i = 0; $i < 4; $i++) {\r
             $aMD5[$i] = implode('', array_reverse(@explode("\0", chunk_split($aMD5[$i], 2, "\0"))));\r
@@ -2650,7 +2650,7 @@ X-OIM-Sequence-Num: 1
         }\r
 \r
         // Step 2: A new string\r
-        $chl_id = $code.PROD_ID;\r
+        $chl_id = $code.self::PROD_ID;\r
         $chl_id .= str_repeat('0', 8 - (strlen($chl_id) % 8));\r
 \r
         $aID = @explode("\0", substr(chunk_split($chl_id, 4, "\0"), 0, -1));\r
@@ -2700,7 +2700,7 @@ X-OIM-Sequence-Num: 1
         // $key = bcadd(bcmul($high, 0x100000000), $low);\r
 \r
         // Step 4: Using the key\r
-        $md5Hash = md5($code.PROD_KEY);\r
+        $md5Hash = md5($code.self::PROD_KEY);\r
         $aHash = @explode("\0", chunk_split($md5Hash, 8, "\0"));\r
 \r
         $hash = '';\r
@@ -2766,7 +2766,7 @@ X-OIM-Sequence-Num: 1
         $password = htmlspecialchars($this->password);\r
 \r
         if ($url === '')\r
-            $passport_url = PASSPORT_URL;\r
+            $passport_url = self::PASSPORT_URL;\r
         else\r
             $passport_url = $url;\r
 \r