$this->addContact($email, 1, $email, true);\r
$this->connectToSBSession('Passive', $sb_ip, $sb_port, $email, array('sid' => $sid, 'ticket' => $ticket));\r
break;\r
+ \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 */, $email, $network, $nickname, /* clientid */, /* dbobj */) = @explode(' ', $data);\r
+ $this->callHandler('StatusChange', array('screenname' => $email, 'network' => $network, 'nickname' => $nickname));\r
+ break;\r
+ \r
case 'OUT':\r
// force logout from NS\r
// NS: <<< OUT xxx\r
*\r
* Handler List\r
* IMIn, Pong, ConnectFailed, Reconnect,\r
- * AddedToList, RemovedFromList\r
+ * AddedToList, RemovedFromList, StatusChange\r
*\r
* @param string $event Event name\r
* @param string $handler User function to call\r
*\r
* @return void\r
*/\r
- function connect() {\r
+ public function connect() {\r
if (!$this->conn) {\r
$this->conn = new MSN(\r
array(\r
* @param void $data Not used (there to keep callback happy)\r
* @return void\r
*/\r
- function handle_connect_failed($data) {\r
+ private function handle_connect_failed($data) {\r
common_log(LOG_NOTICE, 'MSN connect failed, retrying');\r
}\r
\r
* @param void $data Not used (there to keep callback happy)\r
* @return void\r
*/\r
- function handle_reconnect($data) {\r
+ private function handle_reconnect($data) {\r
common_log(LOG_NOTICE, 'MSN reconnecting');\r
}\r
+ \r
+ /**\r
+ * Called by callback when contact changes status\r
+ * \r
+ * @param array $data Data\r
+ */\r
+ private function handle_status_change($data) {\r
+ \r
+ }\r
\r
/**\r
* Send a message using the daemon\r
* @param $data Message\r
* @return boolean true on success\r
*/\r
- function send_raw_message($data) {\r
+ public function send_raw_message($data) {\r
$this->connect();\r
if (!$this->conn) {\r
return false;\r