Message class documentation

Authors

Generated by root

Contents -

  1. Software documentation for the Message class
  2. Message types

Software documentation for the Message class

Message : TRXMLNullHandler

Declared in:
Message.h
The Message class represents a message stanza, one of the three types of XML stanza embodying discrete elements within an XMPP connection.

Instance Variables

Method summary

messageWithBody: for: withSubject: type: 

+ (id) messageWithBody: (NSString*)_body for: (JID*)_recipient withSubject: (NSString*)_subject type: (message_type_t)_type;
Constructs a new (outgoing) message, ready for sending. The subject is usually nil for chat messages. The type should be one of MESSAGE_TYPE_{CHAT,ERROR, MESSAGE,GROUPCHAT}. Only those of MESSAGE_TYPE_MESSAGE should (generally) include a subject.

HTMLBody 

- (NSAttributedString*) HTMLBody;
Returns the rich text version of the body.

body 

- (NSString*) body;
Returns the (plain text) body of the message.

compareByTimestamp: 

- (NSComparisonResult) compareByTimestamp: (Message*)_other;
Compare messages to determine their order of sending.

correspondent 

- (JID*) correspondent;
Returns the JID of the sender (for incoming messages) or the recipient (for outgoing messages).

in 

- (BOOL) in;
Returns YES for incoming messages, NO for outgoing.

initWithBody: for: withSubject: type: 

- (id) initWithBody: (NSString*)_body for: (JID*)_recipient withSubject: (NSString*)_subject type: (message_type_t)_type;
Initialise a new message.

subject 

- (NSString*) subject;
Returns the subject of the message.

timestamp 

- (Timestamp*) timestamp;
Returns the oldest timestamp associated with this message (e.g. offline storage). May be broken (TEST).

xml 

- (TRXMLNode*) xml;
Returns the XML representation of the node. Should be deprecated in favour of a method returning the XML string directly to hide the TRXML dependency from users.



Instance Variables for Message Class

body

@protected NSString* body;
Description forthcoming.

correspondent

@protected JID* correspondent;
Description forthcoming.

direction

@protected MessageDirection direction;
Description forthcoming.

html

@protected NSAttributedString* html;
Description forthcoming.

subject

@protected NSString* subject;
Description forthcoming.

timestamps

@protected NSMutableArray* timestamps;
Description forthcoming.

type

@protected message_type_t type;
Description forthcoming.

unknownAttributes

@protected NSMutableDictionary* unknownAttributes;
Description forthcoming.




Message types

MessageDirection

typedef enum ... MessageDirection;
Description forthcoming.

message_type_t

typedef enum ... message_type_t;
Description forthcoming.