ObjXMPP  Check-in [ffc2f54b93]

Overview
Comment:Oops, forgot a few changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ffc2f54b93c22beacc2aa8844f1e964a8e94864d1094ed30ea9bce232315082e
User & Date: js on 2012-02-04 12:57:49
Other Links: manifest | tags
Context
2012-02-06
11:40
Add XMPPStorage and XMPPJSONFileStorage. check-in: 0fdfdf778f user: js tags: trunk
2012-02-04
12:57
Oops, forgot a few changes. check-in: ffc2f54b93 user: js tags: trunk
12:32
Oops, forgot to adjust tests. check-in: 2178192b6f user: js tags: trunk
Changes

Modified src/XMPPConnection.h from [2a2611c59b] to [0ab968f4e6].

339
340
341
342
343
344
345
346


347
348


349
350
351
352
353
354
355
339
340
341
342
343
344
345

346
347
348

349
350
351
352
353
354
355
356
357







-
+
+

-
+
+







- (void)XMPP_sendResourceBind;
- (void)XMPP_sendStreamError: (OFString*)condition
			text: (OFString*)text;
- (void)XMPP_handleIQ: (XMPPIQ*)iq;
- (void)XMPP_handleMessage: (XMPPMessage*)message;
- (void)XMPP_handlePresence: (XMPPPresence*)presence;
- (void)XMPP_handleFeatures: (OFXMLElement*)element;
- (void)XMPP_handleResourceBind: (XMPPIQ*)iq;
- (void)XMPP_handleResourceBindForConnection: (XMPPConnection*)connection
				      withIQ: (XMPPIQ*)iq;
- (void)XMPP_sendSession;
- (void)XMPP_handleSession: (XMPPIQ*)iq;
- (void)XMPP_handleSessionForConnection: (XMPPConnection*)connection
				 withIQ: (XMPPIQ*)iq;
- (OFString*)XMPP_IDNAToASCII: (OFString*)domain;
- (XMPPMulticastDelegate*)XMPP_delegates;
/// \endcond
@end

@interface OFObject (XMPPConnectionDelegate) <XMPPConnectionDelegate>
@end

Modified src/XMPPConnection.m from [a92b5f400a] to [7e095e71b8].

938
939
940
941
942
943
944
945


946
947
948
949
950
951
952
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952
953







-
+
+







						    namespace: XMPP_NS_BIND
						  stringValue: resource]];

	[iq addChild: bind];

	[self		sendIQ: iq
	    withCallbackObject: self
		      selector: @selector(XMPP_handleResourceBind:)];
		      selector: @selector(XMPP_handleResourceBindForConnection:
				    withIQ:)];
}

- (void)XMPP_sendStreamError: (OFString*)condition
			text: (OFString*)text
{
	OFXMLElement *error = [OFXMLElement
	    elementWithName: @"error"
961
962
963
964
965
966
967
968


969
970
971
972
973
974
975
962
963
964
965
966
967
968

969
970
971
972
973
974
975
976
977







-
+
+







			  namespace: XMPP_NS_XMPP_STREAM
			stringValue: text]];
	[parser setDelegate: nil];
	[self sendStanza: error];
	[self close];
}

- (void)XMPP_handleResourceBind: (XMPPIQ*)iq
- (void)XMPP_handleResourceBindForConnection: (XMPPConnection*)connection
				      withIQ: (XMPPIQ*)iq
{
	OFXMLElement *bindElement;
	OFXMLElement *jidElement;

	assert([[iq type] isEqual: @"result"]);

	bindElement = [iq elementForName: @"bind"
997
998
999
1000
1001
1002
1003
1004


1005
1006
1007


1008
1009
1010
1011
1012
1013
1014
999
1000
1001
1002
1003
1004
1005

1006
1007
1008
1009

1010
1011
1012
1013
1014
1015
1016
1017
1018







-
+
+


-
+
+








	iq = [XMPPIQ IQWithType: @"set"
			     ID: [self generateStanzaID]];
	[iq addChild: [OFXMLElement elementWithName: @"session"
					  namespace: XMPP_NS_SESSION]];
	[self		sendIQ: iq
	    withCallbackObject: self
		      selector: @selector(XMPP_handleSession:)];
		      selector: @selector(
				    XMPP_handleSessionForConnection:withIQ:)];
}

- (void)XMPP_handleSession: (XMPPIQ*)iq
- (void)XMPP_handleSessionForConnection: (XMPPConnection*)connection
				 withIQ: (XMPPIQ*)iq
{
	if (![[iq type] isEqual: @"result"])
		assert(0);

	[delegates broadcastSelector: @selector(connection:wasBoundToJID:)
			  withObject: self
			  withObject: JID];

Modified src/XMPPRoster.h from [d2f88013f2] to [963ba59e66].

131
132
133
134
135
136
137
138


139
140
141
142
143
144
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145







-
+
+






 */
- (void)removeDelegate: (id <XMPPRosterDelegate>)delegate;

/// \cond internal
- (void)XMPP_addRosterItem: (XMPPRosterItem*)rosterItem;
- (void)XMPP_updateRosterItem: (XMPPRosterItem*)rosterItem;
- (void)XMPP_deleteRosterItem: (XMPPRosterItem*)rosterItem;
- (void)XMPP_handleInitialRoster: (XMPPIQ*)iq;
- (void)XMPP_handleInitialRosterForConnection: (XMPPConnection*)connection
				       withIQ: (XMPPIQ*)iq;
- (XMPPRosterItem*)XMPP_rosterItemWithXMLElement: (OFXMLElement*)element;
/// \endcond
@end

@interface OFObject (XMPPRosterDelegate) <XMPPRosterDelegate>
@end

Modified src/XMPPRoster.m from [eaf6a2879a] to [606dc8ad06].

75
76
77
78
79
80
81
82


83
84
85
86
87
88
89
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90







-
+
+








	iq = [XMPPIQ IQWithType: @"get"
			     ID: [connection generateStanzaID]];
	[iq addChild: [OFXMLElement elementWithName: @"query"
					  namespace: XMPP_NS_ROSTER]];
	[connection     sendIQ: iq
	    withCallbackObject: self
		      selector: @selector(XMPP_handleInitialRoster:)];
		      selector: @selector(XMPP_handleInitialRosterForConnection:
			withIQ:)];
}

- (BOOL)connection: (XMPPConnection*)connection_
      didReceiveIQ: (XMPPIQ*)iq
{
	OFXMLElement *rosterElement;
	OFXMLElement *element;
232
233
234
235
236
237
238
239


240
241
242
243
244
245
246
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247
248







-
+
+








	if ([groups count] > 0)
		[rosterItem setGroups: groups];

	return rosterItem;
}

- (void)XMPP_handleInitialRoster: (XMPPIQ*)iq
- (void)XMPP_handleInitialRosterForConnection: (XMPPConnection*)connection
				       withIQ: (XMPPIQ*)iq
{
	OFXMLElement *rosterElement;
	OFEnumerator *enumerator;
	OFXMLElement *element;
	XMPPRosterItem *rosterItem = nil;

	rosterElement = [iq elementForName: @"query"