Msn:Dev

= MSN Plugin Developer Notes =

The documentation regarding the codebase so that developers can hack, extend and contribute to this plugin development.

Plugin Structure
The plugin structure allows an easy to extend format that will allow more and more address books to be tapped in. Following is the structure of directories.

/Msn msnmanager.php MsnPlugin.php msn_waiting_message.php README /extlib /phpmsnclass msnmanager.php contains the IM manager class

MsnPlugin.php contains the IM plugin class

msn_waiting_message.php contains the class representing a waiting message object from the database table

The phpmsnclass directory contains the modified phpmsnclass library

phpmsnclass
At the time of writing phpmsnclass was the only reasonably developed MSNP15 PHP library. However, the use of process forking and looping in addition to some bugs meant that a number of changes were required to make the library compatible with the StatusNet IM architecture. The version of the library was thus changed to &ldquo;2.0s&rdquo;.

Session Setup Limitations
To send a message using the MSN protocol, you must first establish a session with the other user. Unfortunately, this is an asynchronous process (see http://msnpiki.msnfanatic.com/index.php/Switchboard:Authentication). StatusNet&rsquo;s IM architecture polls the queue of messages waiting to be sent and tries to send each a number of times.The issue is that these attempts can all be in a very short space of time, ie, before the session is ready.

The best solution to this problem would be to use the Delayed Queue to remove each message from the regular queue and reinsert it after a set period of time in which the session should be ready. However, at the time of writing, the Delayed Queue was not complete so messages waiting for a session to be ready are inserted into a database table (msn_waiting_message, see below for more details) then sent via a callback when the session is ready.

Database Table msn_waiting_message
The msn_waiting_message table stores messages waiting for a session to become ready.

Attribute      Information -  -    id              ID of message screenname     Intended recipient of message message        Message text created        Time when message was queued claimed        Time when message was claimed for sending