Index: src/XMPPJID.h ================================================================== --- src/XMPPJID.h +++ src/XMPPJID.h @@ -24,11 +24,11 @@ #import /** * \brief A class for easy handling of JIDs. */ -@interface XMPPJID: OFObject +@interface XMPPJID: OFObject { /// The JID's localpart OFString *node; /// The JID's domainpart OFString *domain; Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -65,10 +65,26 @@ [self setDomain: [str substringFromIndex: nodesep + 1 toIndex: resourcesep]]; 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; char *nodepart;