Removed hard tabs
This commit is contained in:
		@@ -23,10 +23,10 @@ class MSN {
 | 
				
			|||||||
    const PROD_KEY = 'PK}_A_0N_K%O?A9S';
 | 
					    const PROD_KEY = 'PK}_A_0N_K%O?A9S';
 | 
				
			||||||
    const PROD_ID = 'PROD0114ES4Z%Q5W';
 | 
					    const PROD_ID = 'PROD0114ES4Z%Q5W';
 | 
				
			||||||
    const LOGIN_METHOD = 'SSO';
 | 
					    const LOGIN_METHOD = 'SSO';
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    const OIM_SEND_URL = 'https://ows.messenger.msn.com/OimWS/oim.asmx';
 | 
					    const OIM_SEND_URL = 'https://ows.messenger.msn.com/OimWS/oim.asmx';
 | 
				
			||||||
    const OIM_SEND_SOAP = 'http://messenger.live.com/ws/2006/09/oim/Store2';
 | 
					    const OIM_SEND_SOAP = 'http://messenger.live.com/ws/2006/09/oim/Store2';
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    const OIM_MAILDATA_URL = 'https://rsi.hotmail.com/rsi/rsi.asmx';
 | 
					    const OIM_MAILDATA_URL = 'https://rsi.hotmail.com/rsi/rsi.asmx';
 | 
				
			||||||
    const OIM_MAILDATA_SOAP = 'http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMetadata';
 | 
					    const OIM_MAILDATA_SOAP = 'http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMetadata';
 | 
				
			||||||
    const OIM_READ_URL = 'https://rsi.hotmail.com/rsi/rsi.asmx';
 | 
					    const OIM_READ_URL = 'https://rsi.hotmail.com/rsi/rsi.asmx';
 | 
				
			||||||
@@ -42,16 +42,16 @@ class MSN {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const DELMEMBER_URL = 'https://contacts.msn.com/abservice/SharingService.asmx';
 | 
					    const DELMEMBER_URL = 'https://contacts.msn.com/abservice/SharingService.asmx';
 | 
				
			||||||
    const DELMEMBER_SOAP = 'http://www.msn.com/webservices/AddressBook/DeleteMember';
 | 
					    const DELMEMBER_SOAP = 'http://www.msn.com/webservices/AddressBook/DeleteMember';
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    // the message length (include header) is limited (maybe since WLM 8.5 released)
 | 
					    // the message length (include header) is limited (maybe since WLM 8.5 released)
 | 
				
			||||||
    // for WLM: 1664 bytes
 | 
					    // for WLM: 1664 bytes
 | 
				
			||||||
    // for YIM: 518 bytes
 | 
					    // for YIM: 518 bytes
 | 
				
			||||||
    const MAX_MSN_MESSAGE_LEN = 1664;
 | 
					    const MAX_MSN_MESSAGE_LEN = 1664;
 | 
				
			||||||
    const MAX_YAHOO_MESSAGE_LEN = 518;
 | 
					    const MAX_YAHOO_MESSAGE_LEN = 518;
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private $debug;
 | 
					    private $debug;
 | 
				
			||||||
    private $timeout;
 | 
					    private $timeout;
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private $id;
 | 
					    private $id;
 | 
				
			||||||
    private $ticket;
 | 
					    private $ticket;
 | 
				
			||||||
    private $user = '';
 | 
					    private $user = '';
 | 
				
			||||||
@@ -76,7 +76,7 @@ class MSN {
 | 
				
			|||||||
    private $port = 1863;
 | 
					    private $port = 1863;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private $clientid = '';
 | 
					    private $clientid = '';
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private $error = '';
 | 
					    private $error = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private $authed = false;
 | 
					    private $authed = false;
 | 
				
			||||||
@@ -181,7 +181,7 @@ class MSN {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Signon methods
 | 
					     * Signon methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Connect to the NS server
 | 
					     * Connect to the NS server
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -345,7 +345,7 @@ class MSN {
 | 
				
			|||||||
        /* FIXME Don't implement the signon as a loop or we could hang
 | 
					        /* FIXME Don't implement the signon as a loop or we could hang
 | 
				
			||||||
        *        the queue handler! */
 | 
					        *        the queue handler! */
 | 
				
			||||||
        $this->debug_message('*** Trying to connect to MSN network');
 | 
					        $this->debug_message('*** Trying to connect to MSN network');
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        // Remove any remaining switchboard sessions
 | 
					        // Remove any remaining switchboard sessions
 | 
				
			||||||
        $this->switchBoardSessions = array();
 | 
					        $this->switchBoardSessions = array();
 | 
				
			||||||
        $this->switchBoardSessionLookup = array();
 | 
					        $this->switchBoardSessionLookup = array();
 | 
				
			||||||
@@ -483,9 +483,9 @@ class MSN {
 | 
				
			|||||||
    * @return void
 | 
					    * @return void
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    private function signonFailure($message) {
 | 
					    private function signonFailure($message) {
 | 
				
			||||||
    	if(!empty($message)) {
 | 
					        if(!empty($message)) {
 | 
				
			||||||
            $this->debug_message($message);
 | 
					            $this->debug_message($message);
 | 
				
			||||||
    	}
 | 
					        }
 | 
				
			||||||
        $this->callHandler('ConnectFailed');
 | 
					        $this->callHandler('ConnectFailed');
 | 
				
			||||||
        $this->NSRetryWait($this->retry_wait);
 | 
					        $this->NSRetryWait($this->retry_wait);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -509,7 +509,7 @@ class MSN {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * NS and SB command handling methods
 | 
					     * NS and SB command handling methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Read and handle incoming command from NS
 | 
					     * Read and handle incoming command from NS
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -532,7 +532,7 @@ class MSN {
 | 
				
			|||||||
            $this->signon();
 | 
					            $this->signon();
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        switch (substr($data, 0, 3)) {
 | 
					        switch (substr($data, 0, 3)) {
 | 
				
			||||||
            case 'SBS':
 | 
					            case 'SBS':
 | 
				
			||||||
                // after 'USR {id} OK {user} {verify} 0' response, the server will send SBS and profile to us
 | 
					                // after 'USR {id} OK {user} {verify} 0' response, the server will send SBS and profile to us
 | 
				
			||||||
@@ -898,14 +898,14 @@ class MSN {
 | 
				
			|||||||
                $this->addContact($email, 1, $email, true);
 | 
					                $this->addContact($email, 1, $email, true);
 | 
				
			||||||
                $this->connectToSBSession('Passive', $sb_ip, $sb_port, $email, array('sid' => $sid, 'ticket' => $ticket));
 | 
					                $this->connectToSBSession('Passive', $sb_ip, $sb_port, $email, array('sid' => $sid, 'ticket' => $ticket));
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            
 | 
					
 | 
				
			||||||
            case 'NLN':
 | 
					            case 'NLN':
 | 
				
			||||||
                // NS: <<< NLN {status} {email} {networkid} {nickname} {clientid} {dpobj}
 | 
					                // NS: <<< NLN {status} {email} {networkid} {nickname} {clientid} {dpobj}
 | 
				
			||||||
                // NS: <<< NLN NLN darkip@inflatablegoldfish.com 1 Luke 2685403136 0
 | 
					                // NS: <<< NLN NLN darkip@inflatablegoldfish.com 1 Luke 2685403136 0
 | 
				
			||||||
                @list(/* NLN */, $status, $email, $network, $nickname) = @explode(' ', $data);
 | 
					                @list(/* NLN */, $status, $email, $network, $nickname) = @explode(' ', $data);
 | 
				
			||||||
                $this->callHandler('StatusChange', array('screenname' => $email, 'status' => $status, 'network' => $network, 'nickname' => $nickname));
 | 
					                $this->callHandler('StatusChange', array('screenname' => $email, 'status' => $status, 'network' => $network, 'nickname' => $nickname));
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            
 | 
					
 | 
				
			||||||
            case 'OUT':
 | 
					            case 'OUT':
 | 
				
			||||||
                // force logout from NS
 | 
					                // force logout from NS
 | 
				
			||||||
                // NS: <<< OUT xxx
 | 
					                // NS: <<< OUT xxx
 | 
				
			||||||
@@ -1357,7 +1357,7 @@ class MSN {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Switchboard related methods
 | 
					     * Switchboard related methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Send a request for a switchboard session
 | 
					     * Send a request for a switchboard session
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1410,12 +1410,12 @@ class MSN {
 | 
				
			|||||||
            'offline' => false,
 | 
					            'offline' => false,
 | 
				
			||||||
            'XFRReqTime' => time()
 | 
					            'XFRReqTime' => time()
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        // Change the index of the session to the socket
 | 
					        // Change the index of the session to the socket
 | 
				
			||||||
        $intsocket = (int) $socket;
 | 
					        $intsocket = (int) $socket;
 | 
				
			||||||
        $this->switchBoardSessions[$intsocket] = $this->switchBoardSessions[$to];
 | 
					        $this->switchBoardSessions[$intsocket] = $this->switchBoardSessions[$to];
 | 
				
			||||||
        unset($this->switchBoardSessions[$to]);
 | 
					        unset($this->switchBoardSessions[$to]);
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        $id = &$this->switchBoardSessions[$intsocket]['id'];
 | 
					        $id = &$this->switchBoardSessions[$intsocket]['id'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($mode == 'Active') {
 | 
					        if ($mode == 'Active') {
 | 
				
			||||||
@@ -1432,7 +1432,7 @@ class MSN {
 | 
				
			|||||||
            $this->sb_writeln($socket, $id, "ANS $id $this->user $ticket $sid");
 | 
					            $this->sb_writeln($socket, $id, "ANS $id $this->user $ticket $sid");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Called when we want to end a switchboard session
 | 
					    * Called when we want to end a switchboard session
 | 
				
			||||||
    * or a switchboard session ends
 | 
					    * or a switchboard session ends
 | 
				
			||||||
@@ -1486,7 +1486,7 @@ class MSN {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if ($this->sb_writeln($socket, $id, "MSG $id N $len") === false ||
 | 
					        if ($this->sb_writeln($socket, $id, "MSG $id N $len") === false ||
 | 
				
			||||||
            $this->sb_writedata($socket, $aMessage) === false) {
 | 
					            $this->sb_writedata($socket, $aMessage) === false) {
 | 
				
			||||||
            	return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Don't close the SB session, we might as well leave it open
 | 
					        // Don't close the SB session, we might as well leave it open
 | 
				
			||||||
@@ -1522,23 +1522,23 @@ class MSN {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public function sendMessage($to, $message) {
 | 
					    public function sendMessage($to, $message) {
 | 
				
			||||||
        if ($message != '') {
 | 
					        if ($message != '') {
 | 
				
			||||||
        	$toParts = explode('@', $to);
 | 
					            $toParts = explode('@', $to);
 | 
				
			||||||
        	if(count($toParts) < 3) {
 | 
					            if(count($toParts) < 3) {
 | 
				
			||||||
        		list($name, $host) = $toParts;
 | 
					                list($name, $host) = $toParts;
 | 
				
			||||||
        		$network = 1;
 | 
					                $network = 1;
 | 
				
			||||||
        	} else {
 | 
					            } else {
 | 
				
			||||||
        		list($name, $host, $network) = $toParts;
 | 
					                list($name, $host, $network) = $toParts;
 | 
				
			||||||
        	}
 | 
					            }
 | 
				
			||||||
        	
 | 
					
 | 
				
			||||||
            $recipient = $name.'@'.$host;
 | 
					            $recipient = $name.'@'.$host;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($network === 1) {
 | 
					            if ($network === 1) {
 | 
				
			||||||
                if (!isset($this->switchBoardSessionLookup[$recipient])) {
 | 
					                if (!isset($this->switchBoardSessionLookup[$recipient])) {
 | 
				
			||||||
                   	if (!isset($this->switchBoardSessions[$recipient]) || time() - $this->switchBoardSessions[$recipient]['XFRReqTime'] > $this->XFRReqTimeout) {
 | 
					                    if (!isset($this->switchBoardSessions[$recipient]) || time() - $this->switchBoardSessions[$recipient]['XFRReqTime'] > $this->XFRReqTimeout) {
 | 
				
			||||||
                   		$this->debug_message("*** No existing SB session or request has timed out");
 | 
					                        $this->debug_message("*** No existing SB session or request has timed out");
 | 
				
			||||||
	                    $this->reqSBSession($recipient);
 | 
					                        $this->reqSBSession($recipient);
 | 
				
			||||||
                   	}
 | 
					                    }
 | 
				
			||||||
                   	return false;
 | 
					                    return false;
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    $socket = $this->switchBoardSessionLookup[$recipient];
 | 
					                    $socket = $this->switchBoardSessionLookup[$recipient];
 | 
				
			||||||
                    $intsocket = (int) $socket;
 | 
					                    $intsocket = (int) $socket;
 | 
				
			||||||
@@ -1547,18 +1547,18 @@ class MSN {
 | 
				
			|||||||
                        $this->endSBSession($socket);
 | 
					                        $this->endSBSession($socket);
 | 
				
			||||||
                        return $this->sendMessage($recipient.'@Offline', $message);
 | 
					                        return $this->sendMessage($recipient.'@Offline', $message);
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                    	if ($this->switchBoardSessions[$intsocket]['joined'] !== true) {
 | 
					                        if ($this->switchBoardSessions[$intsocket]['joined'] !== true) {
 | 
				
			||||||
                    		$this->debug_message("*** Recipient has not joined session, returning false");
 | 
					                            $this->debug_message("*** Recipient has not joined session, returning false");
 | 
				
			||||||
                    		return false;
 | 
					                            return false;
 | 
				
			||||||
                    	}
 | 
					                        }
 | 
				
			||||||
                    	
 | 
					
 | 
				
			||||||
                        $this->debug_message("*** Attempting to send message to $recipient using existing SB session");
 | 
					                        $this->debug_message("*** Attempting to send message to $recipient using existing SB session");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if ($this->sendMessageViaSB($recipient, $message)) {
 | 
					                        if ($this->sendMessageViaSB($recipient, $message)) {
 | 
				
			||||||
                            $this->debug_message('*** Message sent successfully');
 | 
					                            $this->debug_message('*** Message sent successfully');
 | 
				
			||||||
                            return true;
 | 
					                            return true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        
 | 
					
 | 
				
			||||||
                        return false;
 | 
					                        return false;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@@ -1603,7 +1603,7 @@ class MSN {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * OIM methods
 | 
					     * OIM methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Get OIM mail data
 | 
					    * Get OIM mail data
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -1806,7 +1806,7 @@ class MSN {
 | 
				
			|||||||
            $this->debug_message("*** OIM ($msgid) deleted");
 | 
					            $this->debug_message("*** OIM ($msgid) deleted");
 | 
				
			||||||
        return $sMsg;
 | 
					        return $sMsg;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Send offline message
 | 
					     * Send offline message
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1918,11 +1918,11 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return array('challenge' => $challenge, 'auth_policy' => $auth_policy);
 | 
					        return array('challenge' => $challenge, 'auth_policy' => $auth_policy);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Contact / Membership list methods
 | 
					     * Contact / Membership list methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Fetch contact list
 | 
					    * Fetch contact list
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -2347,7 +2347,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
 | 
					        $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
 | 
				
			||||||
        curl_close($curl);
 | 
					        curl_close($curl);
 | 
				
			||||||
        $this->debug_message("*** Get Result:\n$data");
 | 
					        $this->debug_message("*** Get Result:\n$data");
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        if ($http_code != 200) return false;
 | 
					        if ($http_code != 200) return false;
 | 
				
			||||||
        $p = $data;
 | 
					        $p = $data;
 | 
				
			||||||
        $aMemberships = array();
 | 
					        $aMemberships = array();
 | 
				
			||||||
@@ -2427,11 +2427,11 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return $aContactList;
 | 
					        return $aContactList;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * MsnObj related methods
 | 
					     * MsnObj related methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param $FilePath 圖檔路徑
 | 
					     * @param $FilePath 圖檔路徑
 | 
				
			||||||
@@ -2471,14 +2471,14 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        return $DefineString;
 | 
					        return $DefineString;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Socket methods
 | 
					     * Socket methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Read data of specified size from NS socket
 | 
					     * Read data of specified size from NS socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param integer $size Size to read
 | 
					     * @param integer $size Size to read
 | 
				
			||||||
     * @return string Data read
 | 
					     * @return string Data read
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -2497,7 +2497,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Read line from the NS socket
 | 
					     * Read line from the NS socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @return string Data read
 | 
					     * @return string Data read
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private function ns_readln() {
 | 
					    private function ns_readln() {
 | 
				
			||||||
@@ -2511,9 +2511,9 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Write line to NS socket
 | 
					     * Write line to NS socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * Also increments id
 | 
					     * Also increments id
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param string $data Line to write to socket
 | 
					     * @param string $data Line to write to socket
 | 
				
			||||||
     * @return mixed Bytes written or false on failure
 | 
					     * @return mixed Bytes written or false on failure
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -2528,7 +2528,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Write data to NS socket
 | 
					     * Write data to NS socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param string $data Data to write to socket
 | 
					     * @param string $data Data to write to socket
 | 
				
			||||||
     * @return mixed Bytes written or false on failure
 | 
					     * @return mixed Bytes written or false on failure
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -2542,7 +2542,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Read data of specified size from given SB socket
 | 
					     * Read data of specified size from given SB socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param resource $socket SB socket
 | 
					     * @param resource $socket SB socket
 | 
				
			||||||
     * @param integer $size Size to read
 | 
					     * @param integer $size Size to read
 | 
				
			||||||
     * @return string Data read
 | 
					     * @return string Data read
 | 
				
			||||||
@@ -2562,7 +2562,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Read line from given SB socket
 | 
					     * Read line from given SB socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param resource $socket SB Socket
 | 
					     * @param resource $socket SB Socket
 | 
				
			||||||
     * @return string Line read
 | 
					     * @return string Line read
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -2577,9 +2577,9 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Write line to given SB socket
 | 
					     * Write line to given SB socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * Also increments id
 | 
					     * Also increments id
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param resource $socket SB socket
 | 
					     * @param resource $socket SB socket
 | 
				
			||||||
     * @param integer $id Reference to SB id
 | 
					     * @param integer $id Reference to SB id
 | 
				
			||||||
     * @param string $data Line to write
 | 
					     * @param string $data Line to write
 | 
				
			||||||
@@ -2596,7 +2596,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Write data to given SB socket
 | 
					     * Write data to given SB socket
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param resource $socket SB socket
 | 
					     * @param resource $socket SB socket
 | 
				
			||||||
     * @param $data Data to write to socket
 | 
					     * @param $data Data to write to socket
 | 
				
			||||||
     * @return mixed Bytes written or false on error
 | 
					     * @return mixed Bytes written or false on error
 | 
				
			||||||
@@ -2628,11 +2628,11 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        $info = stream_get_meta_data($socket);
 | 
					        $info = stream_get_meta_data($socket);
 | 
				
			||||||
        return $info['eof'];
 | 
					        return $info['eof'];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Key generation methods
 | 
					     * Key generation methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private function derive_key($key, $magic) {
 | 
					    private function derive_key($key, $magic) {
 | 
				
			||||||
        $hash1 = mhash(MHASH_SHA1, $magic, $key);
 | 
					        $hash1 = mhash(MHASH_SHA1, $magic, $key);
 | 
				
			||||||
        $hash2 = mhash(MHASH_SHA1, $hash1.$magic, $key);
 | 
					        $hash2 = mhash(MHASH_SHA1, $hash1.$magic, $key);
 | 
				
			||||||
@@ -2661,7 +2661,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return base64_encode($blob);
 | 
					        return base64_encode($blob);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Generate challenge response
 | 
					    * Generate challenge response
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -2741,11 +2741,11 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return $hash;
 | 
					        return $hash;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Utility methods
 | 
					     * Utility methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private function Array2SoapVar($Array, $ReturnSoapVarObj = true, $TypeName = null, $TypeNameSpace = null) {
 | 
					    private function Array2SoapVar($Array, $ReturnSoapVarObj = true, $TypeName = null, $TypeNameSpace = null) {
 | 
				
			||||||
        $ArrayString = '';
 | 
					        $ArrayString = '';
 | 
				
			||||||
        foreach($Array as $Key => $Val) {
 | 
					        foreach($Array as $Key => $Val) {
 | 
				
			||||||
@@ -2773,7 +2773,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        if ($ReturnSoapVarObj) return new SoapVar($ArrayString, XSD_ANYXML, $TypeName, $TypeNameSpace);
 | 
					        if ($ReturnSoapVarObj) return new SoapVar($ArrayString, XSD_ANYXML, $TypeName, $TypeNameSpace);
 | 
				
			||||||
        return $ArrayString;
 | 
					        return $ArrayString;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    private function linetoArray($lines) {
 | 
					    private function linetoArray($lines) {
 | 
				
			||||||
        $lines = str_replace("\r", '', $lines);
 | 
					        $lines = str_replace("\r", '', $lines);
 | 
				
			||||||
        $lines = explode("\n", $lines);
 | 
					        $lines = explode("\n", $lines);
 | 
				
			||||||
@@ -2784,7 +2784,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return $Data;
 | 
					        return $Data;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Get Passport ticket
 | 
					    * Get Passport ticket
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -3031,7 +3031,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        $this->ABAuthHeader = new SoapHeader('http://www.msn.com/webservices/AddressBook', 'ABAuthHeader', $this->Array2SoapVar($ABAuthHeaderArray));
 | 
					        $this->ABAuthHeader = new SoapHeader('http://www.msn.com/webservices/AddressBook', 'ABAuthHeader', $this->Array2SoapVar($ABAuthHeaderArray));
 | 
				
			||||||
        return $aTickets;
 | 
					        return $aTickets;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Generate the data to send a message
 | 
					    * Generate the data to send a message
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -3050,7 +3050,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        $msg = substr($sMessage, 0, $maxlen);
 | 
					        $msg = substr($sMessage, 0, $maxlen);
 | 
				
			||||||
        return $msg_header.$msg;
 | 
					        return $msg_header.$msg;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Sleep for the given number of seconds
 | 
					    * Sleep for the given number of seconds
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
@@ -3060,7 +3060,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        $this->debug_message("*** Sleeping for $wait seconds before retrying");
 | 
					        $this->debug_message("*** Sleeping for $wait seconds before retrying");
 | 
				
			||||||
        sleep($wait);
 | 
					        sleep($wait);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sends a ping command
 | 
					     * Sends a ping command
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -3072,7 +3072,7 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
        // NS: >>> PNG
 | 
					        // NS: >>> PNG
 | 
				
			||||||
        $this->ns_writeln("PNG");
 | 
					        $this->ns_writeln("PNG");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Methods to add / call callbacks
 | 
					    * Methods to add / call callbacks
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
@@ -3117,24 +3117,24 @@ X-OIM-Sequence-Num: 1
 | 
				
			|||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Debugging methods
 | 
					     * Debugging methods
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Print message if debugging is enabled
 | 
					     * Print message if debugging is enabled
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param string $str Message to print
 | 
					     * @param string $str Message to print
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private function debug_message($str) {
 | 
					    private function debug_message($str) {
 | 
				
			||||||
        if (!$this->debug) return;
 | 
					        if (!$this->debug) return;
 | 
				
			||||||
        echo $str."\n";
 | 
					        echo $str."\n";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Dump binary data
 | 
					     * Dump binary data
 | 
				
			||||||
     * 
 | 
					     *
 | 
				
			||||||
     * @param string $str Data string
 | 
					     * @param string $str Data string
 | 
				
			||||||
     * @return Binary data
 | 
					     * @return Binary data
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user