blockedContacts Property

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.

Gets the ContactCollection that contains all of the contacts in the user's block list.

Feature:  Messenger.Core
Namespace:  Microsoft.Live.Messenger

// To retrieve:
var blockedContacts = instance.get_blockedContacts();

Return Value

A ContactCollection object that contains a list of the user's blocked contacts.

Each user maintains a list of blocked contacts who are not allowed to see the user's presence status or send instant messages to the user. These contacts are tracked in the BlockedContacts collection.

The BlockedContacts collection is mutually exclusive of the allowedContacts collection. Adding a contact to the blocked collection removes it from the allowed collection, and vice versa.

The following code example demonstrates how to get each blocked contact in the block list.

            // Get the messenger context and the User object. 
            messengerContext = wl.App.get_messengerContext(); 
            user = messengerContext.get_user(); 
            // Get each contact in the blocked contact list and display a message confirming that they are on the blocked list. 
            for (i = 0; i < user.get_blockedContacts().get_count(); i++)
                var blockedContact = user.get_blockedContacts().get_item(i); 
                alert(blockedContact.get_fullname() + " is on your blocked contact list.");

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