Export (0) Print
Expand All

Contact Class

Ff749001.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 a Windows Live Messenger contact.

Script:  http://js.live.net/4.1/loader.js
Feature:  Messenger.Core
Namespace:  Microsoft.Live.Messenger
 
Ff749001.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, instantiating, and deriving from classes, see Creating Custom Client Script by Using the Microsoft Ajax Library.

Microsoft.Live.Messenger.Contact = function();

Type.registerClass(
    'Microsoft.Live.Messenger.Contact',
    null,
    Microsoft.Live.Messenger.INotifyPropertyChanged);

A Messenger contact is another user that the current user can interact with within Windows Live Messenger. The user can have the contact on his or her contact list, or the contact may be specific to the application that the user is currently using.

A contact can be rendered by using the displayName property. This property dynamically computes the preferred name for a contact by using a variety of values that are associated with it.

A contact comprises one or more instant-messaging addresses. Each associated IMAddress is found in the addresses property of the contact. At any given time, one address is considered to be the primary address and can be obtained from the currentAddress property.

The isOnline property can be used to determine whether a particular contact is online in Messenger. More detailed presence information for a contact can be obtained from the presence property.

The following code example demonstrates how to send a predefined message to each online contact.


             // Get the Messenger context and the array of the user's contacts that are currently online. 
             messengerContext = wl.App.get_messengerContext(); 
             var onlineContacts = messengerContext.getOnlineContacts(); 
             var message = new Microsoft.Live.Messenger.TextMessage("Hello!");
             // Send the predefined message to each contact in the list. 
             for (i = 0; i < onlineContacts.get_count(); i++)
             { 
                 var contact = onlineContacts.get_item(i); messengerContext.sendMessage(contact.get_cid(), message);
             }
             

Object
  Microsoft.Live.Messenger..::.Contact

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:
© 2015 Microsoft