Notification - Statuses
|
Printable Version
|
What are statuses?
Statuses represent a user's online state. A user can be online, or a user can be offline. There are also "sub-statuses": if a user is online, he or she might be available, away, busy, etc. "Appearing offline" is a special type of status, where a user appears to be offline to everyone, but is still connected to the NS and can receive notifications and make changes.
Everyone in your contact list, or more specifically, your allow list, can see your online 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
Status Codes
Every status is represented by a three-letter status code. There are nine total status codes. Three of these are main statuses: online, offline, and hidden (appearing offline). The other six are all sub-statuses of the online status.
Main Statuses
NLN - Online - This status is used when a user is connected to the NS and is not appearing offline. It is the parent of all six sub-statuses. If a sub-status is used, NLN is replaced with the sub-status, but the user is still considered online, just less available.
FLN - Offline - This status is used for a user that is not connected to the NS. If a user has blocked you, is appearing offline, or has not approved your "add a contact" request, this status will be sent to you even if they are truly online.
HDN - Hidden - This status is only seen by the user who sets it, and is never received as a status of someone on a contact list. If a user sets his or her status to hidden, every single user will see this user as offline. The user remains connected to the NS, but has limited capabilities (including, most importantly, no transfers to SB).
Sub-Statuses
BSY - Busy
IDL - Idle
BRB - Be Right Back
AWY - Away
PHN - On the Phone
LUN - Out to Lunch
Setting Your Status
To set or change your status, send the CHG command with a TrID and the three letter status code as your status. The server will reply with a CHG with your TrID and your new status (it should look exactly like what you sent). If you send an invalid status code, the server will most likely disconnect you immediately. Because status codes are case sensitive, sending nln will result in the server closing the connection as well. Here are some examples of using the CHG command:
>>> CHG 12 NLN\r\n
<<< CHG 12 NLN\r\n
>>> CHG 13 HDN\r\n
<<< CHG 13 HDN\r\n
>>> CHG 15 AWY\r\n
<<< CHG 14 AWY\r\n
If you attempt to change your status too rapidly, you may receive error 800 in response to some CHG s.
Initial Status
After you send your final USR to the NS with your digested password, you should set your initial status. The official client always immediately sets the status to NLN , and any status is acceptable. You could make your client log in as HDN and nobody would even know that you logged in.
If you do not set your initial status, you will basically be considered HDN and can do everything you can do in that status. The only exception I have noticed is that you will not receive initial statuses or changes of status from users on your contact list.
Being FLN or HDN
Unlike a few years ago, you can no longer set your status to FLN . Even if you identify yourself with the VER command as using an older version, it still will not work. You will receive error 201 for invalid parameter.
You can however set your status to HDN , which means you are "appearing offline". To every other user, you will appear to be FLN , but you are still connected to the NS. You can do almost everything as normal on the NS: sync contact lists, change your friendly name, receive status notifications, etc. However, the only thing that you cannot do is request XFR s (transfers) to the SB, and you will never receive any RNG s. In other words, no chatting. If you do send an XFR , you will receive error 913.
Receiving Statuses
You will automatically receive the status of every user on your forward list when you first log on and when a status changes. Note that you only receive an online status if the user has you in his or her allow list.
Initial Statuses
After you send your initial status, you will receive the initial status of every online user on your forward list. Assume that every other user is offline. You will receive a list of ILN commands with the same TrID as your initial CHG . If no users are online, you will receive no ILN s. You don't ever know when the list of ILN s is complete: [FIND OFFICIAL CLIENT TIMEOUT]
- The first parameter of each
ILN is the user's three letter status code (never FLN or HDN ).
- The second parameter is the user's account name.
- The third and final parameter is the user's URL-encoded screen name.
Here is an example of receiving a list of online users:
>>> CHG 12 NLN\r\n
>>> PNG\r\n
<<< CHG 12 NLN\r\n
<<< ILN 12 AWY example@passport.com Mike\r\n
<<< ILN 12 NLN name_123@hotmail.com Name_123\r\n
<<< ILN 12 BSY myname@msn.com My%20Name\r\n
<<< QNG\r\n
Status Changes
Every time a user on your forward list changes his or her status, you will receive a notification with the new status. Of course, that is only true if you have sent your initial status. Otherwise, you don't get any status notifications.
You receive status notifications with two commands: NLN and FLN . Yes, those are three-letter commands as well as status codes. An NLN is sent when a user changes their state to one of the online states. This does not necessarily mean that the user has just signed on, it only means that the user has changed their status to either NLN or any of its sub-statuses. FLN is used when a user goes offline.
Note that a user doesn't actually have to change their status to a different status than what they were previously set to. A user can set themselves as BRB twenty times in a row, and you will receive all twenty NLN commands.
Also, whenever a user changes their friendly name, you will receive either an NLN or an FLN depending on whether they are online or [appearing] offline (obviously they cannot change their friendly name if they are truly offline). You will receive the new friendly name if it is an NLN command because the friendly name is one of the parameters, but if it is an FLN , you will not receive the new friendly name. That friendly name can only be updated when the user goes online next, or when you sync your lists next.
The syntax for both NLN and FLN are unusual because they are asynchronous (they are not in response to any client command previously sent). They do not have TrIDs. The NLN command has three parameters: the first is the three letter status code, the second is the user's account name, and the third is the user's friendly name. The syntax for FLN is much simpler; it just has one parameter, which is the user's account name.
Here are some examples of what you can receive from the server:
<<< NLN NLN example@passport.com Mike\r\n
<<< NLN AWY example@passport.com Mike\r\n
<<< NLN AWY example@passport.com Mike%20Changed%20His%20Name\r\n
<<< FLN example@passport.com\r\n
|