A watcher (also known as a subscriber) is an entity who receives the presence information published by a publishing presentity. When one user subscribes to another user's presence by passing a non-null contextDataparameter in the RemotePresentitySubscriptionTarget( uri, contextData) constructor, and intends to build a contact relationship with the publishing user, the server notifies the publishing user of the subscription request.

After the publishing user is notified with the subscription request, he or she is expected to acknowledge the request to the server so that the server can remove the entry that caused the notification to occur. This is an opportunity for the publishing user to find out who is subscribing to the information being published, and to place the subscribing user in the appropriate access control list (ACL) using the update operations in the ContainerUpdateOperationclass. The notified user acknowledges the request by calling the BeginAcknowledgeSubscribermethod, which is declared as follows:

Copy Code
public IAsyncResult BeginAcknowledgeSubscriber(string subscriberId,
AsyncCallback userCallback, object state);

An application can register for watcher notification by registering a handler for the SubscriberNotificationReceivedevent on a LocalOwnerPresenceinstance. The SubscriberNotificationEventArgsclass, which is associated with this event, has a WatcherListproperty that lists all watchers who have subscribed to the application’s presence information.

If the WatcherListproperty contains multiple new watchers, acknowledge only the first one.

Notification is not a gatekeeping mechanism. A user cannot prevent others from adding him or her to their list although the user being added can determine whether to use the existing container membership for this subscriber or update the container membership for this subscriber.