Change -[XMPPMessage addBody:] to -[XMPPMessage setBody:].

This commit is contained in:
Jonathan Schleifer 2012-02-03 09:05:51 +01:00
parent 3d5d7564a7
commit d6c5f1d91e
2 changed files with 14 additions and 7 deletions

View file

@ -77,10 +77,17 @@
ID: ID_];
}
- (void)addBody: (OFString*)body
- (void)setBody: (OFString*)body
{
[self addChild: [OFXMLElement elementWithName: @"body"
namespace: XMPP_NS_CLIENT
stringValue: body]];
OFXMLElement *oldBody = [self elementForName: @"body"
namespace: XMPP_NS_CLIENT];
if (oldBody != nil)
[self removeChild: oldBody];
if (body != nil)
[self addChild: [OFXMLElement elementWithName: @"body"
namespace: XMPP_NS_CLIENT
stringValue: body]];
}
@end