PresenceStatus Enumeration
TOC
Collapse the table of content
Expand the table of content

PresenceStatus Enumeration

Ff748215.note(en-us,MSDN.10).gifNote:
Current information about Live Connect is now available in the Windows Live Developer Center. The information in the following sections is provided for legacy purposes only.

Represents the status of a contact or an instant messaging address.

Script:  http://js.live.net/4.1/loader.js
Feature:  Messenger.Core
Namespace:  Microsoft.Live.Messenger
 
Ff748215.alert_note(en-us,MSDN.10).gifNote

The JavaScript Library for Windows Live Messenger Connect is built by using the Microsoft Ajax Library. Microsoft Ajax exposes a type system that enables you to add object-oriented capabilities to your JavaScript code. To learn more about creating and using enumerations, see Creating Custom Client Script by Using the Microsoft Ajax Library.

// Declaration:
Microsoft.Live.Messenger.PresenceStatus = function() {};
Microsoft.Live.Messenger.PresenceStatus.prototype = {
    offline       : 0,
    online        : 1,
    appearOffline : 2,
    busy          : 3,
    idle          : 4,
    beRightBack   : 5,
    away          : 6,
    inACall       : 7,
    outToLunch    : 8
};
Microsoft.Live.Messenger.PresenceStatus.registerEnum(
    'Microsoft.Live.Messenger.PresenceStatus',
    false);

// Usage:
if (Microsoft.Live.Messenger.PresenceStatus.outToLunch == value) {

}

Users are able to sign into Messenger and then modify their status to reflect their availability. The PresenceStatus includes the list of allowed states that a user can assign. As the user modifies his or her status, each of the contacts in the user's allowedContacts collection are notified of a status change.

To modify the user's status, the new status should be provided to the status property of the presence property on User.

Modern Windows Live Messenger clients do not expose beRightBack, inACall and outToLunch. Instead, the clients map these to away, busy and away respectively.

The example demonstrates how to perform custom logic based on a contact's particular status.

            switch (contact.get_presence().get_status()) {
                case Microsoft.Live.Messenger.PresenceStatus.offline:
                    disableConversationWith(contact);
                    break;
                    
                default:
                    enableConversationWith(contact);
                    break;
            }
            

Windows Live Messenger Connect

Supported in: 4.1

Windows Live Messenger Web Toolkit

Supported in: 3.7, 3.5, 3.1, 3.0, 2.5, 2.0, 1.0

Internet Explorer 8.0, Internet Explorer 7.0, Internet Explorer 6.0, Firefox 3.6, Firefox 3.5, Firefox 3.0, Firefox 2.0, Firefox 1.5, Chrome 4.0, Chrome 3.0, Chrome 2.0, Chrome 1.0, Safari 4.0, Safari 3.0, Opera 10.5

Show:
© 2016 Microsoft