MSN Messenger Protocol
What is presence information?
"Presence" information, in its broadest sense, is information about the present state of the principal and/or the client. In MSNP8, this includes your status (busy, idle, hidden, etc.), your display name, and a number representing various information about the client (e.g. webcam support).
Here is an example presence notification command sent by the server:
This notifies you that the principal with passport "email@example.com" is able to receive instant messages but is away from the computer, and would like you to refer to him as "example display name". It also notifies you that his client can understand MSNC1 and is capable of viewing "ink" messages.
Statuses represent a principal's on-line state. There are two basic states a principal can be in: open ("on-line") and closed ("offline"). When your status is open, you can chat with other people, when it's closed, you can't. When you disconnect from the notification server, your status automatically becomes closed, but when you connect to the server, you have to manually open your status. Closing your status while remaining on-line is referred to as "hiding" or "appearing offline".
Everyone in your contact list, or more specifically, your allow list, can see your status. You can see the status of everyone that has you in their allow list, and you will automatically receive the status of everyone in your forward list
Open principals must set a "sub-state". This doesn't affect how the server treats them, but may be of interest to other principals:
You can also set your own sub-state to
In order to properly understand how client identification works in MSN Messenger, you would need a basic understanding binary arithmetic. This site assumes no knowledge of binary, so this discussion of client ID numbers is quite shallow. Client identification are very similar to list numbers, only more complicated.
The client ID number is the sum of several values specifying capabilities advertised by the client the client protocol version it supports. Here are the values that we know to be used in client identification:
To create a client ID number, sum the values in the above list which apply to your client. For example, if your client is a mobile phone supporting MSNC0, your client number is 1. Whereas if your client supports MSNC2, is able to receive ink messages and would like to advertise voice chat support, your client ID number would be 536870932 (536870912 + 16 + 4). Note: you can only specify one supported client protocol - if you use both "268435456" and "536870912" in your client identification, clients will behave unpredictably towards you.
Just like with list numbers, you can extract values from another principal's client ID number by bitwise ANDing the client ID with the value. This is the advised method for getting client capabilities, but it's better to get the client version number by dividing the client ID by 268435456 and rounding down to the nearest integer. This is called "modulo division", and most programming languages have a function or mathematical operator for it. For MSNC0 clients, modulo division will always return 0, for MSNC1 clients, it'll always return 1, and for MSNC2 clients, it'll always return 2.
Using modulo division to get the client version is safer than bitwise AND because it's suspected that the value for MSNC3 will be "805306368" (the sum of MSNC1 and MSNC2). This causes problems for bitwise AND, but is fine for modulo division (which will return 3).
"Ink" is a technology from Microsoft that allows you to handwrite on a screen. It's available in tablet PCs, recent versions of Microsoft's Platform SDK, and in Microsoft's next version of Windows code-named "Longhorn".
A developer who worked on putting ink functionality into MSN Messenger has a page talking about his work.
Setting Your Presence
To manually set or change your status, send the
If you attempt to change your status too rapidly, you may receive error 800 in response to some
After synchronising your details with the server, you should set your initial status. The official client always immediately sets the status to
Until you set your initial presence, your status will remain closed and you won't receive presence notifications. If you want to keep your presence closed after logging on, you should set your initial status to
You used to be able to set your status to
Changing your display name
Changing your display name is done using the
Initial Presence notification
Initial presence notifications indicate that a principal was already online before you logged in (or before you added them to your forward list). After you send your initial status, you will receive an
Clients shouldn't take special measures to notify the principal when receiving an initial presence notification. For example, the official client doesn't pop up a message when it receives an initial online notification.
Here is an example of receiving a list of online principals:
Change of Presence Notification
Once you've sent your initial presence, changes of presence from principals on your forward list will cause the server to send you a notification.
When a principal closes their presence (either by disconnecting or hiding), the server sends an
The server will send an
The syntax for the