The MSN Messenger Protocol Torn Apart: Part 1/3 - Order the List (Page 5 of 7 )
Now is the time to ask for your contact list. Before I proceed, let me tell you about the four types of lists. Firstly we have the forward list denoted by 'FL'. It consists of the users on your contact list. Secondly we have the reverse list denoted by 'RL'. It consists of all the users who have added you to their contact lists. Thirdly we have the 'AL' or the allow list. These are the users who are allowed to see your online status. Finally, we have the block list denoted by 'BL'. These are the users who you have blocked. Get the idea? Let me summarize it for you once more:
FL Forward list (Users who you have added to your contact list)
RL Reverse list (Users who have added you to their respective contact list)
AL Allow list (Users who are permitted to see your status)
BL Block list (Users who are not permitted to see your status)
We have a command called LST, which we could use to request any of these lists. The command we would send to the server to request our forward list would look like this:
LST 8 FL
Firstly, we have the command identifier LST. Next we have the transaction id of this command. Finally, we have a two-letter list code that we want to request from the server. Yes, you could replace FL with RL, AL or BL, depending on which list you want to request from the server:
The server replies to us with all of the users on our list. There are four lines because we have four users on our list. Lets look at what all of these parameters the server sent us mean.
Firstly we have the command identifier LST. Then we have the transaction id (which is the same as one we sent to the server. This is just to let us know that all of these commands are in response to that one LST command we sent to the server). The next parameter is something called a list version id, i.e. 35 in all the lines.
Next we have the users serial number. It's just like a normal counter. After that, we have a parameter that tells us the total number of users in this list. In this case it is 4. Moving on, we have the email id of the user on our list. The screen name of the user is next, followed finally by the group id.
I haven't yet come to groups so lets keep that pending for now but do keep in mind; the last parameter is the group id of that respective user.
More on Statuses Once you are connected to your messenger account, the server would send you the status of each user on your list. We did use the CHG command initially. Do you remember what that was for? Yes, that was to change our initial status. The command looked like this:
CHG 7 HDN
The transaction id we used for this command was 7.
Remember that whenever the server notifies us of the status of users on our contact list, it would send us necessary commands using the same transaction id we used to send the CHG command to the server. In this case the server would use 7. Lets have a closer look:
These are the commands that the server sent us once we connected to our messenger account. We assume there are just two people on our contact list. Each line denotes the status details of a user. We start of with ILN, which is the command identifier. It is the command used to notify initial statues of users on your forward list. Then we have the transaction id i.e.7 (I already explained why it is 7). Next we have the current status of that user. In the first line it is BSY that denotes Busy. In the second line it is 'AWY' that denotes Away. We have a list of parameters that denote the current status of the user. For e.g. NLN denotes online, AWY denotes away, PHN denotes on the phone etc.
A list of these parameters and what each one does is present in Microsoft's official draft on the protocol. I have attached the same at the end of this article. Lastly, we have the respective users email id and finally his screen name.
Apart from these steps, the messenger has to be ready for many other commands sent to the client from the server. The client should understand, recognize and respond to every kind of command sent to it from the server to avoid any kind of errors.