The InstantMessagingSettingsproperty provides access to global configuration settings for instant message (IM) flows using an InstantMessagingFlowTemplateobject.

The following code shows the settings that can be configured for IM flows (represented by InstantMessagingFlowobjects) using the InstantMessagingFlowTemplateclass.

Copy Code
// Initializes the flow with default values. 
public InstantMessagingFlowTemplate();

// Initializes the flow with the given SupportedFormats. 
public InstantMessagingFlowTemplate(InstantMessagingFormat flags);

// Initializes the flow with values from the specified flow
template.
public InstantMessagingFlowTemplate(InstantMessagingFlowTemplate
source);

// Provides access to a list of ContentTypes supported by IM flow.
public InstantMessagingFormat SupportedFormats {get;set;}

// Gets the value that indicates the consumption mode of the
application.
// Represents the setting for an application to indicate how it
intends to handle instant messages.
// The incoming messages are handled accordingly. If the
application consumes messages locally,
// incoming messages are automatically acknowledged with a 200
response code.
// If the application proxies the messages, the incoming messages
are automatically
// acknowledged with a 202 response code (if the remote supports
message delivery notificiations)
// or if the response is delayed. The application is responsible
for sending a delivery
// notification later for every message received. By default,
// the value is InstantMessageConsumptionMode.ConsumedLocally.
public InstantMessageConsumptionMode MessageConsumptionMode
{get;set;}

// Gets or sets the value (in seconds) for composing time-out. This
is used to control the default value
// used for all instant messaging flows. The default value is 3
seconds. The maximum value is 30 seconds.
public int ComposingTimeoutValue {get; set;}
}

Applications specify their consumption mode using the InstantMessageConsumptionModeenumeration. The following table lists the enumeration values for this type.

Enumeration value Description

ConsumedLocally

The message is consumed locally as soon as it is delivered. This is the default consumption mode.

ProxiedToRemoteEntity

The message is proxied to a remote entity. The success or failure of the delivery is known only later.

If the application hosts a remote client, there can be a delay when the client sends the typing indications to a backend server. For this reason, the default value of three seconds for the idle time-out period may not be long enough. The application can set the idle time-out period to a larger value using flow settings.

The SupportedFormatsproperty lists the content types that the application supports for consuming messages received in the flow.

The internal IM media provider supports the sending and receiving of delivery notification messages that are sent by applications that do not directly consume messages, but serve as proxies for delivering the received messages to remote entities. Office Communicator Web Access is an example of such an application. If an application configures the flow as ProxiedToRemoteEntity, the application must register for the MessageReceivedevent on the flow, and must send message delivery notifications with the BeginSendSuccessDeliveryNotificationor BeginSendFailureDeliveryNotificationmethod.

InstantMessagingFlowexposes the DeliveryNotificationReceivedevent, which is raised when an incoming delivery notification message is received. InstantMessagingFlowalso exposes two methods to send delivery notifications to the message sender: BeginSendFailureDeliveryNotificationand BeginSendSuccessDeliveryNotification.