ObjXMPP  Diff

Differences From Artifact [309d096214]:

To Artifact [aacb5f2723]:


207
208
209
210
211
212
213











214
215
216
217
218
219
220
{
	XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"bind0"];
	[iq addChild: [OFXMLElement elementWithName: @"bind"
					  namespace: NS_BIND]];

	[self sendStanza: iq];
}












- (void)_handleFeatures: (OFXMLElement*)elem
{
	for (OFXMLElement *child in elem.children) {
		if ([[child name] isEqual: @"mechanisms"] &&
		    [[child namespace] isEqual: NS_SASL])
			[self _addAuthMechanisms: child];







>
>
>
>
>
>
>
>
>
>
>







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
{
	XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"bind0"];
	[iq addChild: [OFXMLElement elementWithName: @"bind"
					  namespace: NS_BIND]];

	[self sendStanza: iq];
}

- (void)_handleResourceBind: (XMPPIQ*)iq
{
	OFXMLElement *bindElem = iq.children.firstObject;
	if ([bindElem.name isEqual: @"bind"] &&
	    [bindElem.namespace isEqual: NS_BIND]) {
		OFXMLElement *jidElem = bindElem.children.firstObject;
		of_log(@"Bound to JID: %@", [jidElem.children.firstObject
				stringValue]);
	}
}

- (void)_handleFeatures: (OFXMLElement*)elem
{
	for (OFXMLElement *child in elem.children) {
		if ([[child name] isEqual: @"mechanisms"] &&
		    [[child namespace] isEqual: NS_SASL])
			[self _addAuthMechanisms: child];
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
			// FIXME: Handle!
	}

	if ([elem.name isEqual: @"iq"] &&
	    [elem.namespace isEqual: NS_CLIENT]) {
		XMPPIQ *iq = [XMPPIQ stanzaWithElement: elem];
		if ([iq.ID isEqual: @"bind0"] && [iq.type isEqual: @"result"]) {
			OFXMLElement *bindElem = iq.children.firstObject;
			OFXMLElement *jidElem = bindElem.children.firstObject;
			of_log(@"Bound to JID: %@",
				[jidElem.children.firstObject stringValue]);
		}
	}
}

- (void)elementBuilder: (OFXMLElementBuilder*)b
  didNotExpectCloseTag: (OFString*)name
	    withPrefix: (OFString*)prefix
	     namespace: (OFString*)ns
{
	// TODO
}
@end







|
<
<
<












269
270
271
272
273
274
275
276



277
278
279
280
281
282
283
284
285
286
287
288
			// FIXME: Handle!
	}

	if ([elem.name isEqual: @"iq"] &&
	    [elem.namespace isEqual: NS_CLIENT]) {
		XMPPIQ *iq = [XMPPIQ stanzaWithElement: elem];
		if ([iq.ID isEqual: @"bind0"] && [iq.type isEqual: @"result"]) {
			[self _handleResourceBind: iq];



		}
	}
}

- (void)elementBuilder: (OFXMLElementBuilder*)b
  didNotExpectCloseTag: (OFString*)name
	    withPrefix: (OFString*)prefix
	     namespace: (OFString*)ns
{
	// TODO
}
@end