ObjXMPP  Check-in [014e7a9d68]

Overview
Comment:Make use of the XMPPStanza convenience functions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 014e7a9d68a124bbbc622be361582e2c3f45b307b459973995350c97bc1c123f
User & Date: florob@babelmonkeys.de on 2011-03-24 17:57:34
Other Links: manifest | tags
Context
2011-03-27
21:50
Don't synthesize the getter when the setter isn't synthesized. check-in: 6b038b0cf6 user: js tags: trunk
2011-03-24
17:57
Make use of the XMPPStanza convenience functions check-in: 014e7a9d68 user: florob@babelmonkeys.de tags: trunk
17:57
Handle nil as argument to XMPPStanza's setters check-in: d6b5e4a4e1 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPConnection.m from [a1cc431680] to [be8ca31728].

415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
	}

	if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
		handled = [delegate connection: self
				  didReceiveIQ: iq];

	if (!handled) {
		OFString *from = [iq attributeForName: @"from"].stringValue;
		OFString *to = [iq attributeForName: @"to"].stringValue;
		OFXMLElement *error;

		[iq setType: @"error"];

		[iq removeAttributeForName: @"from"];
		[iq removeAttributeForName: @"to"];

		if (from != nil)
			[iq addAttributeWithName: @"to"
				     stringValue: from];
		if (to != nil)
			[iq addAttributeWithName: @"from"
				     stringValue: to];

		error = [OFXMLElement elementWithName: @"error"];
		[error addAttributeWithName: @"type"
				stringValue: @"cancel"];
		[error addChild:
		    [OFXMLElement elementWithName: @"service-unavailable"
					namespace: NS_STANZAS]];







|
|




<
<
|
|
<
<
<
<
<







415
416
417
418
419
420
421
422
423
424
425
426
427


428
429





430
431
432
433
434
435
436
	}

	if ([delegate respondsToSelector: @selector(connection:didReceiveIQ:)])
		handled = [delegate connection: self
				  didReceiveIQ: iq];

	if (!handled) {
		XMPPJID *from = iq.from;
		XMPPJID *to = iq.to;
		OFXMLElement *error;

		[iq setType: @"error"];



		iq.to = from;
		iq.from = to;






		error = [OFXMLElement elementWithName: @"error"];
		[error addAttributeWithName: @"type"
				stringValue: @"cancel"];
		[error addChild:
		    [OFXMLElement elementWithName: @"service-unavailable"
					namespace: NS_STANZAS]];