diff --git a/src/XMPPJID.h b/src/XMPPJID.h index ea80782..ccfdc1f 100644 --- a/src/XMPPJID.h +++ b/src/XMPPJID.h @@ -26,7 +26,7 @@ /** * \brief A class for easy handling of JIDs. */ -@interface XMPPJID: OFObject +@interface XMPPJID: OFObject { /// The JID's localpart OFString *node; diff --git a/src/XMPPJID.m b/src/XMPPJID.m index 580916b..65fd60d 100644 --- a/src/XMPPJID.m +++ b/src/XMPPJID.m @@ -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;