using System;
using System.Collections;
namespace MSNP{
/// <summary>
/// A type representing a message sent from a user in a session.
/// </summary>
/// <remarks>
/// Various messages are sent by the MSN Messenger application. Many of them
/// are not text meant for the user, such as the Typing Message (which notifies other users
/// in the session that the specified user is currently typing a message). Be sure to check
/// the Content-Type and ensure that it is text/plain before displaying it to a user
/// or processing it as a user-typed message.
/// </remarks>
public class MimeMessage
{
private Hashtable m_Headers;
private String m_Body;
private String m_SenderHandle;
private String m_SenderFriendlyName;
internal MimeMessage(IDictionary headers, String body, String senderHandle, String senderFriendly)
{
m_Headers = new Hashtable(headers);
m_Body = body;
m_SenderHandle = senderHandle;
m_SenderFriendlyName = senderFriendly;
}
/// <summary>
/// The body or text of the message
/// </summary>
/// <remarks>
/// This mostly applies to user-typed messages and not system or management-related messages.
/// Ensure the Content-Type header is text/plain before treating it as a user-typed message.
/// </remarks>
public String Body{ get{ return m_Body; } }
/// <summary>
/// A dictionary of headers included in the MIME header part of the message.
/// </summary>
/// <remarks>
/// Every message must have the MIME-Version and Content-Type headers. Other headers may be
/// included depending on the Content-Type of the message.
/// </remarks>
public IDictionary Headers{ get{ return (IDictionary)m_Headers; } }
/// <summary>
/// The handle (email) of the user who sent the message.
/// </summary>
public String SenderHandle{ get{ return m_SenderHandle; } }
/// <summary>
/// The friendly name (full name or display name) of the user who sent the message.
/// </summary>
public String SenderFriendlyName{ get{ return m_SenderFriendlyName; } }
}
}
|