HTML
  Home arrow HTML arrow Page 4 - The MSN Messenger Protocol Torn Apart: Par...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

The MSN Messenger Protocol Torn Apart: Part 1/3
By: Neville Mehta
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 86
    2002-10-20

    Table of Contents:
  • The MSN Messenger Protocol Torn Apart: Part 1/3
  • Digging Into the Protocol
  • The Workings of the Protocol
  • Change Your Initial Status
  • Order the List
  • User Statuses
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The MSN Messenger Protocol Torn Apart: Part 1/3 - Change Your Initial Status


    (Page 4 of 7 )

    After we are authenticated, the first thing we do is to change our current status. We have a command called CHG. This command helps us to change our current status. This is what we sent to the server to change our initial status:

    CHG 7 NLN

    We have the command identifier CHG. We have the unique transaction id. We also have a parameter called "NLN". NLN tells the server to change our status to online. Like NLN, we have various parameters for other statuses. For example this would be the command we would send the server if we wanted to change our status to Hidden or Invisible:

    CHG 7 HDN

    Yes, HDN is the parameter we send to tell the server to change our status to Hidden/Invisible. There is a list of these parameters and what each one does in Microsoft's official draft on the protocol. I have attached the same at the end of this article.

    The server then sends us back this reply confirming the status change:

    CHG 7 HDN

    The reply consists of the command identifier, the transaction id and the current status of the user.

    Retrieval of a Few Important Server Messages
    By now, the client should be ready for a few messages from the server. What are these messages? Well, we could regard them as commands sent to us by the server but commands having a different format. We have seen the standard command format, which looks like this:

    <COMMAND IDENTIFIER> <TRANSACTION ID> <PARAMETERS>

    The message command doesn't in anyway look like this. If we see one such message we would be able to understand the format. As soon as we notify the server of our initial status, the server sends us this message command:

    MSG Hotmail Hotmail 450
    MIME-Version: 1.0
    Content-Type: text/x-msmsgsprofile; charset=UTF-8
    LoginTime: 1034601891
    EmailEnabled: 1
    MemberIdHigh: 93760
    MemberIdLow: -52562410
    lang_preference: 1033
    preferredEmail: neville2150895@hotmail.com
    country: IN
    PostalCode:
    Gender: m
    Kid: 0
    Age: 19
    BDayPre: 2
    Birthday: 30245
    Wallet: 0
    Flags: 1031
    sid: 507
    kv: 4
    MSPAuth: 4voZp65RUDJlf6KzMhWAgJKts*N3Wn8OVQB6AW
    JfFNos3D0een95XDaOLIFTt3q6!L7M*cdoHvKQ6*2NrYOaMG7Q$$

    This is what the command looks like. We first have MSG, which is the command identifier. The next two parameters, say Hotmail and Hotmail and finally the number 450. The number 450 denotes the total number of bytes in the entire message excluding the current line (The line which has MSG in it, the first line).

    Next, we have the mime version and content-type. The mime version would be same in all cases but the mime content-type is "text/x-msmsgsprofile" in this case. The char set of the message is mentioned in the same line thereafter. All the lines after that consist of the mime body.

    This message, which the server sent us contains details about the .NET passport we signed into. The body of this message thus contains details of the user signed in like age, gender, birthday, postal code etc.

    Another such message we should be ready to except is the following one:

    MSG Hotmail Hotmail 221
    MIME-Version: 1.0
    Content-Type: text/x-msmsgsinitialemailnotification; charset=UTF-8

    Inbox-Unread: 0
    Folders-Unread: 2
    Inbox-URL: /cgi-bin/HoTMaiL
    Folders-URL: /cgi-bin/folders
    Post-URL: http://www.hotmail.com


    Again, like all other message commands, this one consists of the command identifier, the two Hotmail parameters and the total number of bytes on the first line. Next we have a mime version, which is the same in all messages and the Content-Type, which is "text/x-msmsgsinitialemailnotification" in this case. We also have the char set on the same line thereafter.

    This message contains details about email in the inbox of the user. You must have noticed when you login into your messenger account and you have any new unread mails you are prompted. Well this is the message responsible for that prompt. You see the string Inbox-Unread :0 in the mime body. That shows there are 0 unread mails in your inbox. This message also has a few other details about your inbox.

    Again, these are messages that your client may or may not want to respond to. I have just included these in this article to let you know about the entire process in detail. In your version of msn messenger it’s entirely up to you to prompt the user about new mail. In this case if you don’t want your messenger to care about new unread mails in your inbox then you could ignore these messages. The first message sent to us by the server, which has the users .NET passport details passed through, is quite useless.

    More HTML Articles
    More By Neville Mehta


     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT