Index: src/XMPPDiscoEntity.h ================================================================== --- src/XMPPDiscoEntity.h +++ src/XMPPDiscoEntity.h @@ -54,21 +54,19 @@ /** * \brief Creates a new autoreleased XMPPDiscoEntity with the specified * connection. * * \param connection The XMPPConnection to serve responses on. - * This must already be bound to a resource) * \return A new autoreleased XMPPDiscoEntity */ + discoEntityWithConnection: (XMPPConnection*)connection; /** * \brief Creates a new autoreleased XMPPDiscoEntity with the specified * connection. * * \param connection The XMPPConnection to serve responses on. - * This must already be bound to a resource) * \param capsNode The node advertised for the entity's capabilites * \return A new autoreleased XMPPDiscoEntity */ + discoEntityWithConnection: (XMPPConnection*)connection capsNode: (OFString*)capsNode; Index: src/XMPPDiscoEntity.m ================================================================== --- src/XMPPDiscoEntity.m +++ src/XMPPDiscoEntity.m @@ -104,10 +104,16 @@ while ((feature = [enumerator nextObject]) != nil) [caps appendFormat: @"%@<", feature]; return [caps SHA1Hash]; } + +- (void)connection: (XMPPConnection*)connection + wasBoundToJID: (XMPPJID*)JID +{ + _JID = [JID copy]; +} - (BOOL)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)IQ { if (![[IQ to] isEqual: _JID]) Index: src/XMPPDiscoNode.m ================================================================== --- src/XMPPDiscoNode.m +++ src/XMPPDiscoNode.m @@ -58,15 +58,10 @@ name: (OFString*)name { self = [super init]; @try { - if (JID == nil) - @throw [OFInvalidArgumentException - exceptionWithClass: [self class] - selector: _cmd]; - _JID = [JID copy]; _node= [node copy]; _name = [name copy]; _identities = [OFSortedList new]; _features = [OFSortedList new];