diff --git a/src/XMPPMessage.h b/src/XMPPMessage.h index 34fd88e..8751f8e 100644 --- a/src/XMPPMessage.h +++ b/src/XMPPMessage.h @@ -27,6 +27,10 @@ * \brief A class describing a message stanza. */ @interface XMPPMessage: XMPPStanza +#ifdef OF_HAVE_PROPERTIES +@property (copy) OFString *body; +#endif + /** * Creates a new autoreleased XMPPMessage. * @@ -94,9 +98,16 @@ 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 diff --git a/src/XMPPMessage.m b/src/XMPPMessage.m index 485481f..f914285 100644 --- a/src/XMPPMessage.m +++ b/src/XMPPMessage.m @@ -90,4 +90,10 @@ namespace: XMPP_NS_CLIENT stringValue: body]]; } + +- (OFString*)body +{ + return [[self elementForName: @"body" + namespace: XMPP_NS_CLIENT] stringValue]; +} @end