Change -[XMPPMessage addBody:] to -[XMPPMessage setBody:].
This commit is contained in:
parent
3d5d7564a7
commit
d6c5f1d91e
2 changed files with 14 additions and 7 deletions
|
@ -94,9 +94,9 @@
|
||||||
ID: (OFString*)ID;
|
ID: (OFString*)ID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a body element to the XMPPMessage
|
* Sets the body element of the XMPPMessage.
|
||||||
*
|
*
|
||||||
* \param body The text content of the body element
|
* \param body The text content of the body element or nil to remove the body
|
||||||
*/
|
*/
|
||||||
- (void)addBody: (OFString*)body;
|
- (void)setBody: (OFString*)body;
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -77,8 +77,15 @@
|
||||||
ID: ID_];
|
ID: ID_];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addBody: (OFString*)body
|
- (void)setBody: (OFString*)body
|
||||||
{
|
{
|
||||||
|
OFXMLElement *oldBody = [self elementForName: @"body"
|
||||||
|
namespace: XMPP_NS_CLIENT];
|
||||||
|
|
||||||
|
if (oldBody != nil)
|
||||||
|
[self removeChild: oldBody];
|
||||||
|
|
||||||
|
if (body != nil)
|
||||||
[self addChild: [OFXMLElement elementWithName: @"body"
|
[self addChild: [OFXMLElement elementWithName: @"body"
|
||||||
namespace: XMPP_NS_CLIENT
|
namespace: XMPP_NS_CLIENT
|
||||||
stringValue: body]];
|
stringValue: body]];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue