ObjXMPP  Diff

Differences From Artifact [ada5800aa3]:

To Artifact [8157f6bcb0]:


17
18
19
20
21
22
23

24
25
26
27
28
29
30
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31







+







 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPDiscoEntity.h"
#import "XMPPDiscoIdentity.h"
#import "XMPPIQ.h"
#import "namespaces.h"

@implementation XMPPDiscoEntity
+ discoEntityWithConnection: (XMPPConnection*)connection
{
	return [[[self alloc] initWithConnection: connection] autorelease];
62
63
64
65
66
67
68



















69
70
71
72
73
74
75
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







}

- (void)addDiscoNode: (XMPPDiscoNode*)node
{
	[_discoNodes setObject: node
			forKey: [node node]];
}

- (OFString*)capsHash
{
	OFMutableString *caps = [OFMutableString string];
	OFEnumerator *enumerator;
	XMPPDiscoIdentity *identity;
	OFString *feature;

	enumerator = [_identities objectEnumerator];
	while ((identity = [enumerator nextObject]) != nil)
		[caps appendFormat: @"%@/%@//%@<", [identity category],
		    [identity type], [identity name]];

	enumerator = [_features objectEnumerator];
	while ((feature = [enumerator nextObject]) != nil)
		[caps appendFormat: @"%@<", feature];

	return [caps SHA1Hash];
}

- (BOOL)connection: (XMPPConnection*)connection
      didReceiveIQ: (XMPPIQ*)IQ
{
	of_log(@"Called connection:didReceiveIQ:... %@ %@", [IQ to], _JID);
	if (![[IQ to] isEqual: _JID])
		return NO;