Make XMPPJID conform to OFCopying.

This commit is contained in:
Jonathan Schleifer 2011-02-19 17:38:25 +01:00
parent a2cf5e17e7
commit f3109b1c7a
2 changed files with 17 additions and 1 deletions

View file

@ -26,7 +26,7 @@
/**
* \brief A class for easy handling of JIDs.
*/
@interface XMPPJID: OFObject
@interface XMPPJID: OFObject <OFCopying>
{
/// The JID's localpart
OFString *node;

View file

@ -68,6 +68,22 @@
return self;
}
- copy
{
XMPPJID *new = [[XMPPJID alloc] init];
@try {
new->node = [node copy];
new->domain = [domain copy];
new->resource = [resource copy];
} @catch (id e) {
[new release];
@throw e;
}
return new;
}
- (void)setNode: (OFString*)node_
{
OFString *old = node;