Protocols/MSNP/MSNP8/Getting Details: Difference between revisions
(Updated SYN to reflect crippled MSNP8 protocol.) |
m (1 revision imported) |
||
(No difference)
|
Revision as of 00:23, 29 May 2020
Authentication . Presence . Challenges . Getting Details . Setting Details . Messages . Miscellaneous . Example Session
What does this page cover?
This page explains how to retrieve your personal details from MSN Messenger. This includes information about people on your contact list, a list of groups they can belong to, your personal phone numbers, and some privacy settings.
When the official client logs on, the first thing it does is send the SYN command to retrieve everything on the contact list. This page gives background information about your contact details and a thorough description of the SYN command. For information about setting your personal details, see Setting Details.
Background Information
These are the basic concepts in MSN's personal information.
Version number
Your complete set of personal details has a version number. Every time a change is made to the contact list, either initiated by you or by someone else, that number is incremented. If your details are changed then changed back (even while you're offline), the number will be incremented twice.
The purpose of this number is to ensure that the client and server have the same version of the contact details. Clients should cache all contact details. When the client logs on, if no changes have been made since it last logged off, it can avoid downloading all of your personal details. The number is always between 0 and 4294967295 (2^32 - 1).
Forward List (FL)
The forward list, abbreviated as FL, is the list of principals whose presence you are subscribed to. You can expect to be notified about their on-line state, phone numbers, etc. This is what a layman would call their "contact list".
As of Tuesday, October 11th, 2005 this has been doubled and doubled again to a confirmed 600 buddies. If you try and add a 601st contact you will receive error 210 and they will not be added. This list previously (as of March 23, 2003), had a limit of 150 people, doubled from a previous 75.
Everyone in your forward list belongs to one or more groups, identified by their group number. By default, they belong to group 0.
Reverse List (RL)
The reverse list, abbreviated as RL, is the list of principals that have you on their forward list. You cannot make modifications to it. If you attempt to add or remove people from this list, you will be immediately disconnected from the NS with no error message.
Allow List (AL)
The allow list, abbreviated as AL, is the list of principals that you allow to see your online presence - as opposed to your reverse list, which is the list of people who request to see your online presence. If someone removes you from his or her contact list, he or she is automatically removed from your RL but not your AL. He or she no longer receives online presence from you, but if he or she adds you again, your client can act in the knowledge that you previously allowed him or her to see your presence.
Block List (BL)
The block list, abbreviated as BL, is the list of people that are blocked from seeing your online presence. They will never receive your status, and when they try to invite you to a switchboard session, they will be notified that you are offline. No-one can be on the AL and the BL at the same time, and if you try to add someone to both lists, you will receive error 219.
Group List
This is a list of groups that people on your forward list can belong to. Every group has a name and a ID number. You are guaranteed to have at least one group defined (which everyone on your contact list belongs to by default). The default name for this list is "~".
The client and server always refer to groups by number rather than name.
Phone Numbers
MSN Messenger allows you to advertise your personal, home, and work phone phone numbers as well as your MSN Mobile and MSN Direct devices if you have them. You should be automatically sent phone number information about people in your FL, but as of November 2003, a bug in Microsoft's servers mean this doesn't happen. You can choose whether or not to make phone numbers available, and blocked people are sent blank phone number information, so there is no big privacy issue with it.
Synchronisation
The SYN ("synchronisation") command is used to synchronise all four contact lists, the group list, your phone numbers, and some privacy settings with the server. The official client synchronises right after it logs on and before it sets its initial status. Sending SYN more than once in a session has no effect, and may get you disconnected. You should send SYN immediately after logging in to the Messenger server, as the server won't send you certain commands (e.g. additions to your reverse list) until you do. Clients in the past could cache their details so they only had to update their lists when a change has occured in the time between two sessions, but this feature is not working anymore.
Sending SYN
The SYN command has a TrID and one parameter. In theory the parameter is the version number of the cached details. Today it does not matter what you send - a 0 (zero) will do it.
It can take quite a while to download all the personal details - over ten seconds for a large list on a slow connection. It might be best to send SYN before setting your initial status so that other people will not have to wait for you to download your list before you can receive their messages.
Here is an example SYN command:
>>> SYN 13 0\r\n
SYN Responses
The response will contain a TrID and three parameters: updated version number (it's always your version number incremented with 1), number of people on your contact list, and number of groups you've defined.
The server will send these extra responses (in this order):
- GTC - what to do when someone adds you to their contact list
- BLP - default list for people who aren't explicitly allowed or blocked
- PRP - your phone numbers (sent once for every enabled/non-empty number)
- LSG - list of groups (sent once for every group you've defined)
- LST - list of people (sent once for every person in your contact list)
None of these responses will have TrIDs.
Example SYN Responses
In this example, the client hasn't stored a cache (since version numbering is not implemented on server side anymore), so the server sends a full list. The gaps in the response have been inserted to make reading easier. There are no blank lines in the protocol.
>>> SYN 1 0\r\n <<< SYN 1 139 6 4\r\n
<<< GTC A\r\n <<< BLP AL\r\n
<<< PRP PHH 01%20234\r\n <<< PRP PHM 56%20789\r\n
<<< LSG 0 Other%20Contacts 0\r\n <<< LSG 1 Coworkers 0\r\n <<< LSG 2 Friends 0\r\n <<< LSG 3 Family 0\r\n
<<< LST principal1@passport.com principal1 4\r\n <<< LST principal2@passport.com principal2 10\r\n <<< LST principal3@passport.com principal3 11 1,3\r\n <<< LST principal4@passport.com principal4 11 0\r\n <<< BPR PHH 01%20234\r\n <<< BPR MOB Y\r\n <<< LST principal5@passport.com principal5 12\r\n <<< LST principal6@passport.com principal6 11 2\r\n <<< BPR PHW 45%206789\r\n
Privacy Settings
There are two privacy settings in MSNP8: GTC and BLP.
GTC
The GTC value can be set to A or N. The client should change its behaviour based on this value. The value isn't processed by the server or advertised to other clients.
The client is expected to use this value in deciding how to behave when someone is added the RL who hasn't previously been put on the AL or BL. It's possible, for example, for someone to have been on your RL once before, then removed, then come back on, in which case they might already be on your block or allow list. The default setting is A. Because the server only stores this value, it's still the client's job to add them to one of the lists - the server will not do this automatically.
If the GTC value is set to A or the BLP value (below) is set to BL, the official client will alert the user when someone new is added to the reverse list and ask whether to allow or block them. Otherwise, it will automatically add them to the allow list.
BLP
Like GTC, the BLP value is stored on the server and is retrieved by the client every time it logs on. This setting also has only two values: AL and BL. Unlike GTC, the server actually reads this setting and does certain things differently depending on its value.
People who are on neither your AL nor BL will be treated as if they are on the list specified in BLP. If the value is AL, they will be allowed to invite you to a switchboard session and chat with you. If the value is BL, they will be informed that you are offline, and they will not be allowed to invite you to chat. The default value is AL.
Phone Numbers
The only time you can receive the phone numbers that you have set for yourself is during a SYN. Personal phone numbers are sent immediately after BLP. These phone numbers arrive in PRP and BPR responses. Each of them has two parameters: a three letter phone type or mobile setting and the corresponding value.
Here is a list of the five different phone number types. It depends on the protocol version which ones are actually send and used.
- PHH - home phone number
- PHW - work phone number
- PHM - mobile phone number
- MOB - are other people authorised to contact me on my MSN Mobile device?
- MBE - do I have a mobile device enabled on MSN Mobile?
- WWE - If set to 2, direct-paging is enabled. 0 otherwise.
For some protocol versions, phone numbers are not always sent if they are empty, MOB and MBE aren't sent unless they are enabled. Because of this, the only way to tell whether you've finished receiving PRPs is when you receive the first LSG response (there will always be at least one LSG response).
The value for the first three items can be anything up to 95 characters. This value can contain any characters allowed in a nickname and is URL Encoded.
The value of MOB and MBE can be Y ("yes") or N ("no"). If MOB is set, the client has allowed other people to contact him on his mobile device through the PAG command. If MBE is set, that shows that the client has enabled a mobile device on MSN Mobile. Note that these values are completely independent from the PHM mobile device number.
There are 'reports' of a sixth phone number type to handle MSN Direct devices. This WWE value works exactly like MOB, but will be set to "2" if it's enabled. This value has never been observed in MSNP8.
Below is an example of the phone numbers of someone who has set her home phone number and has a mobile device but has chosen not to allow people to page her on MSN. Note that the home phone number is URL-encoded, and would show up like this when decoded: "555 555-0690".
<<< PRP PHH 555%20555-0690\r\n <<< PRP MBE Y\r\n
Group List (LSG)
After the PRPs have been sent, the NS will send the list of groups you've defined with the LSG command. The NS will send one LSG for each group. Each LSG will contain an identification number of the group, the URL-encoded name of the group, and a number which the official client always sets to 0 (but you can set it to any number). If you haven't added any groups, the default group name and ID are ~ (tilde) and 0 (zero) respectively.
Contact List (LST)
After sending the LSG responses, the NS will send information about the people on your contact list. The entire synchronisation process is complete when the last LST response has been received.
LST is another response with a variable number of parameters:
- The first parameter is the account name.
- The second parameter is the nickname. (For more information on nicknames, see the Names page)
- The third parameter is a number representing the lists the person is in (discussed below)
- If the person is in your FL, the fourth parameter is a comma-separated list of group numbers they belong to
If the person is in your FL, you will also receive some BPR responses immediately following the LST (if they have set their phone numbers). The format of a BPR response is similar to the PRP responses above, except that there's no such thing as a BPR MBE response. If a principal has MOB set to Y, that means that you can page them with the PAG command. If they have WWE set to 2, you can direct-page them with the PGD command.
It is also possible to receive BPRs outside of a SYN. This is discussed more on the setting details page.
List numbers
The third parameter is the principal's "list number", which represents the lists they're in (allow, block, forward, reverse). Each list has a numerical value - the forward list is 1, the allow list is 2, the block list is 4, the reverse list is 8 and the pending list 16. A principal's list number represents the sum of the lists the principal is in. For example, someone on your forward and allow lists but not your block or reverse lists would have a list number of 3.
Because list values are all powers of 2, you can tell which lists a principal is in with the bitwise AND function. ANDing the principal's list number with the value of a list will tell you whether they are in that list. For example, if a principal's list number is 3, "3 AND 1" returns "1" (meaning that they're on your forward list), "3 AND 2" returns "2" (meaning they're on your allow list), while "3 AND 4" and "3 AND 8" return "0" (meaning they aren't on your block or reverse lists).
Everyone on your reverse list should be on either your allow or block list, but this isn't always the case (for example, if they were added since you last logged off). You can check this by ANDing their list number with 14 (the sum of the add, block and allow lists). If the result is "8", they're on your reverse list but neither of the others. For example, if a buddy's list number is "11", "11 AND 14" returns "10" (meaning they have already been added to your allow list); whereas if their list number is "9", "9 AND 14" returns "8" (meaning they haven't been added to your add or block lists). See GTC above for how to handle these people.
There are some programs that erase everyone from your allow list so that you can appear offline to people while you talk, but when you log back on again with a normal client, they are often flooded with messages about new buddies.