$this->user = $user;\r
$this->password = $password;\r
// NS: <<< USR {id} SSO S {policy} {nonce}\r
- @list(/* USR */, /* id */, /* SSO */, /* S */, $policy, $nonce,) = @explode(' ', $data);\r
+ @list(/* USR */, /* id */, /* SSO */, /* S */, $policy, $nonce) = @explode(' ', $data);\r
\r
$this->passport_policy = $policy;\r
$aTickets = $this->get_passport_ticket();\r
// NS: <<< XFR {id} NS {server} 0 {server}\r
// MSNP15\r
// NS: <<< XFR {id} NS {server} U D\r
- @list(/* XFR */, /* id */, $Type, $server, /* ... */) = @explode(' ', $data);\r
+ @list(/* XFR */, /* id */, $Type, $server) = @explode(' ', $data);\r
if ($Type!='NS') break;\r
@list($ip, $port) = @explode(':', $server);\r
// this connection will close after XFR\r
case 'GCF':\r
// return some policy data after 'USR {id} SSO I {user}' command\r
// NS: <<< GCF 0 {size}\r
- @list(/* GCF */, /* 0 */, $size,) = @explode(' ', $data);\r
+ @list(/* GCF */, /* 0 */, $size) = @explode(' ', $data);\r
// we don't need the data, just read it and drop\r
if (is_numeric($size) && $size > 0)\r
$this->ns_readdata($size);\r
\r
case 'LST':\r
// NS: <<< LST {email} {alias} 11 0\r
- @list(/* LST */, $email, /* alias */,) = @explode(' ', $data);\r
+ @list(/* LST */, $email) = @explode(' ', $data);\r
@list($u_name, $u_domain) = @explode('@', $email);\r
if (!isset($this->aContactList[$u_domain][$u_name][1])) {\r
$this->aContactList[$u_domain][$u_name][1]['Allow'] = 'Allow';\r
case 'ADL':\r
// randomly, we get ADL command, someone add us to their contact list for MSNP15\r
// NS: <<< ADL 0 {size}\r
- @list(/* ADL */, /* 0 */, $size,) = @explode(' ', $data);\r
+ @list(/* ADL */, /* 0 */, $size) = @explode(' ', $data);\r
if (is_numeric($size) && $size > 0) {\r
$data = $this->ns_readdata($size);\r
preg_match('#<ml><d n="([^"]+)"><c n="([^"]+)"(.*) t="(\d*)"(.*) /></d></ml>#', $data, $matches);\r
case 'RML':\r
// randomly, we get RML command, someome remove us to their contact list for MSNP15\r
// NS: <<< RML 0 {size}\r
- @list(/* RML */, /* 0 */, $size,) = @explode(' ', $data);\r
+ @list(/* RML */, /* 0 */, $size) = @explode(' ', $data);\r
if (is_numeric($size) && $size > 0) {\r
$data = $this->ns_readdata($size);\r
preg_match('#<ml><d n="([^"]+)"><c n="([^"]+)"(.*) t="(\d*)"(.*) /></d></ml>#', $data, $matches);\r
case 'MSG':\r
// randomly, we get MSG notification from server\r
// NS: <<< MSG Hotmail Hotmail {size}\r
- @list(/* MSG */, /* Hotmail */, /* Hotmail */, $size,) = @explode(' ', $data);\r
+ @list(/* MSG */, /* Hotmail */, /* Hotmail */, $size) = @explode(' ', $data);\r
if (is_numeric($size) && $size > 0) {\r
$data = $this->ns_readdata($size);\r
$aLines = @explode("\n", $data);\r
case 'UBM':\r
// randomly, we get UBM, this is the message from other network, like Yahoo!\r
// NS: <<< UBM {email} $network $type {size}\r
- @list(/* UBM */, $from_email, $network, $type, $size,) = @explode(' ', $data);\r
+ @list(/* UBM */, $from_email, $network, $type, $size) = @explode(' ', $data);\r
if (is_numeric($size) && $size > 0) {\r
$data = $this->ns_readdata($size);\r
$aLines = @explode("\n", $data);\r
case 'UBX':\r
// randomly, we get UBX notification from server\r
// NS: <<< UBX email {network} {size}\r
- @list(/* UBX */, /* email */, /* network */, $size,) = @explode(' ', $data);\r
+ @list(/* UBX */, /* email */, /* network */, $size) = @explode(' ', $data);\r
// we don't need the notification data, so just ignore it\r
if (is_numeric($size) && $size > 0)\r
$this->ns_readdata($size);\r
case 'CHL':\r
// randomly, we'll get challenge from server\r
// NS: <<< CHL 0 {code}\r
- @list(/* CHL */, /* 0 */, $chl_code,) = @explode(' ', $data);\r
+ @list(/* CHL */, /* 0 */, $chl_code) = @explode(' ', $data);\r
$fingerprint = $this->getChallenge($chl_code);\r
// NS: >>> QRY {id} {product_id} 32\r
// NS: >>> fingerprint\r
// NS: <<< XFR {id} NS {server} U D\r
// for normal switchboard XFR\r
// NS: <<< XFR {id} SB {server} CKI {cki} U messenger.msn.com 0\r
- @list(/* XFR */, /* {id} */, $server_type, $server, /* CKI */, $cki_code, /* ... */) = @explode(' ', $data);\r
+ @list(/* XFR */, /* {id} */, $server_type, $server, /* CKI */, $cki_code) = @explode(' ', $data);\r
@list($ip, $port) = @explode(':', $server);\r
if ($server_type != 'SB') {\r
// maybe exit?\r
// someone is trying to talk to us\r
// NS: <<< RNG {session_id} {server} {auth_type} {ticket} {email} {alias} U {client} 0\r
$this->debug_message("NS: <<< RNG $data");\r
- @list(/* RNG */, $sid, $server, /* auth_type */, $ticket, $email, $name,) = @explode(' ', $data);\r
+ @list(/* RNG */, $sid, $server, /* auth_type */, $ticket, $email, $name) = @explode(' ', $data);\r
@list($sb_ip, $sb_port) = @explode(':', $server);\r
$this->debug_message("*** RING from $email, $sb_ip:$sb_port");\r
$this->addContact($email, 1, $email, true);\r
case 'NLN':\r
// NS: <<< NLN {status} {email} {networkid} {nickname} {clientid} {dpobj}\r
// NS: <<< NLN NLN darkip@inflatablegoldfish.com 1 Luke 2685403136 0\r
- @list(/* NLN */, $status, $email, $network, $nickname, /* clientid */, /* dbobj */,) = @explode(' ', $data);\r
+ @list(/* NLN */, $status, $email, $network, $nickname) = @explode(' ', $data);\r
$this->callHandler('StatusChange', array('screenname' => $email, 'status' => $status, 'network' => $network, 'nickname' => $nickname));\r
break;\r
\r
break;\r
case 'MSG':\r
// SB: <<< MSG {email} {alias} {len}\r
- @list(/* MSG */, $from_email, /* alias */, $len, ) = @explode(' ', $data);\r
+ @list(/* MSG */, $from_email, /* alias */, $len) = @explode(' ', $data);\r
$len = trim($len);\r
$data = $this->sb_readdata($socket, $len);\r
$aLines = @explode("\n", $data);\r
*/\r
public function sendMessage($to, $message) {\r
if ($message != '') {\r
- @list($name, $host, $network) = @explode('@', $to);\r
- $network = $network == '' ? 1 : $network;\r
+ $toParts = explode('@', $to);\r
+ if(count($toParts) < 3) {\r
+ list($name, $host) = $toParts;\r
+ $network = 1;\r
+ } else {\r
+ list($name, $host, $network) = $toParts;\r
+ }\r
+ \r
$recipient = $name.'@'.$host;\r
\r
if ($network === 1) {\r