Make XMPPJID conform to OFCopying.
This commit is contained in:
parent
a2cf5e17e7
commit
f3109b1c7a
2 changed files with 17 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
||||||
/**
|
/**
|
||||||
* \brief A class for easy handling of JIDs.
|
* \brief A class for easy handling of JIDs.
|
||||||
*/
|
*/
|
||||||
@interface XMPPJID: OFObject
|
@interface XMPPJID: OFObject <OFCopying>
|
||||||
{
|
{
|
||||||
/// The JID's localpart
|
/// The JID's localpart
|
||||||
OFString *node;
|
OFString *node;
|
||||||
|
|
|
@ -68,6 +68,22 @@
|
||||||
return self;
|
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_
|
- (void)setNode: (OFString*)node_
|
||||||
{
|
{
|
||||||
OFString *old = node;
|
OFString *old = node;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue