ObjXMPP  Diff

Differences From Artifact [fb7f062274]:

To Artifact [270f41c89f]:


1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







/*
 * Copyright (c) 2013, Florian Zeitz <florob@babelmonkeys.de>
 * Copyright (c) 2013, 2016, Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2013, 2016, 2019, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127







-
+







{
	[_features insertObject: feature];
}

- (void)addChildNode: (XMPPDiscoNode *)node
{
	[_childNodes setObject: node
			forKey: [node node]];
			forKey: node.node];
}

- (bool)xmpp_handleItemsIQ: (XMPPIQ *)IQ
		connection: (XMPPConnection *)connection
{
	XMPPIQ *resultIQ;
	OFXMLElement *response;
139
140
141
142
143
144
145
146
147


148
149
150


151
152

153
154
155
156
157
158
159
139
140
141
142
143
144
145


146
147
148


149
150
151

152
153
154
155
156
157
158
159







-
-
+
+

-
-
+
+

-
+








	for (XMPPDiscoNode *child in _childNodes) {
		OFXMLElement *item =
		    [OFXMLElement elementWithName: @"item"
					namespace: XMPP_NS_DISCO_ITEMS];

		[item addAttributeWithName: @"jid"
			       stringValue: [[child JID] fullJID]];
		if ([child node] != nil)
			       stringValue: child.JID.fullJID];
		if (child.node != nil)
			[item addAttributeWithName: @"node"
				       stringValue: [child node]];
		if ([child name] != nil)
				       stringValue: child.node];
		if (child.name != nil)
			[item addAttributeWithName: @"name"
				       stringValue: [child name]];
				       stringValue: child.name];

		[response addChild: item];
	}

	[connection sendStanza: resultIQ];

	return true;
172
173
174
175
176
177
178
179

180
181
182


183
184

185
186
187
188
189
190
191
172
173
174
175
176
177
178

179
180


181
182
183

184
185
186
187
188
189
190
191







-
+

-
-
+
+

-
+








	for (XMPPDiscoIdentity *identity in _identities) {
		OFXMLElement *identityElement =
		    [OFXMLElement elementWithName: @"identity"
					namespace: XMPP_NS_DISCO_INFO];

		[identityElement addAttributeWithName: @"category"
					  stringValue: [identity category]];
					  stringValue: identity.category];
		[identityElement addAttributeWithName: @"type"
					  stringValue: [identity type]];
		if ([identity name] != nil)
					  stringValue: identity.type];
		if (identity.name != nil)
			[identityElement addAttributeWithName: @"name"
						  stringValue: [identity name]];
						  stringValue: identity.name];

		[response addChild: identityElement];
	}

	for (OFString *feature in _features) {
		OFXMLElement *featureElement =
		    [OFXMLElement elementWithName: @"feature"