Index: src/XMPPMessage.h ================================================================== --- src/XMPPMessage.h +++ src/XMPPMessage.h @@ -25,10 +25,14 @@ /** * \brief A class describing a message stanza. */ @interface XMPPMessage: XMPPStanza +#ifdef OF_HAVE_PROPERTIES +@property (copy) OFString *body; +#endif + /** * Creates a new autoreleased XMPPMessage. * * \return A new autoreleased XMPPMessage */ @@ -92,11 +96,18 @@ */ - initWithType: (OFString*)type ID: (OFString*)ID; /** - * Sets the body element of the XMPPMessage. + * Sets the text content of the body of the XMPPMessage. * * \param body The text content of the body element or nil to remove the body */ - (void)setBody: (OFString*)body; + +/** + * Returns the text content of the body element of the XMPPMessage. + * + * \return The text content of the body element of the XMPPMessage. + */ +- (OFString*)body; @end Index: src/XMPPMessage.m ================================================================== --- src/XMPPMessage.m +++ src/XMPPMessage.m @@ -88,6 +88,12 @@ if (body != nil) [self addChild: [OFXMLElement elementWithName: @"body" namespace: XMPP_NS_CLIENT stringValue: body]]; } + +- (OFString*)body +{ + return [[self elementForName: @"body" + namespace: XMPP_NS_CLIENT] stringValue]; +} @end