Chat room messages

Core concepts

Learn about the programming pattern used with the four Microsoft Lync 2013 SDK types to read messages posted in a Microsoft Lync 2013 Persistent Chat room.

Applies to: Lync 2013 | Lync Server 2013

In this article
Message overview
Retrieving room messages
Room message object model
Additional resources

Message overview

The Microsoft.Lync.Model.Room.RoomMessage class encapsulates a message posted in a room. This class is not used to post messages to a room. A RoomMessage object has attributes that tell you who posted the message, the room it's posted to, the date and time the message was posted, the ID of the message, and the message text.

Retrieving room messages

Messages can only be retrieved from instances of the Microsoft.Lync.Model.Room.Room class to which messages are posted. When a room has been joined or followed, get posted messages by calling asynchronous operations on the room. For information about retrieving room messages, see How to: Read messages sent to a chat room. By registering for the Room.MessagesReceived event, an application is notified when new messages are received.

Room message object model

The room message object model is composed of the Microsoft.Lync.Model.Room.RoomMessage whose attributes include sender and room URIs, ID, and sent time. In addition, the class exposes a property whose value is an object of the Microsoft.Lync.Model.Room.RoomMessageDictionary class. The message dictionary contains message formatting/message text pairs along with additional message attributes.

Important noteImportant

RoomMessageDictionary does not implement IDictionary although it does contain data similar access methods. The RoomMessageDictionary.StoryTitle property and the RoomMessageDictionary.Type property have a one-to-one relationship with the room message itself, while the RoomMessageDictionary.Keys and RoomMessageDictionary.Values properties return collections and have a one-to-many relationship with the room message.

The relationships in this object model allow the API to state that a given room message is an alert, regular, or story message while the message has plain text content and RTF content.

Figure 1. Chat room message object model

Chat room message class model diagram

See also