27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
+
|
#include <assert.h>
#import "XMPPRoster.h"
#import "XMPPRosterItem.h"
#import "XMPPConnection.h"
#import "XMPPIQ.h"
#import "XMPPJID.h"
#import "XMPPMulticastDelegate.h"
#import "namespaces.h"
@implementation XMPPRoster
- initWithConnection: (XMPPConnection*)conn
{
self = [super init];
|
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
|
[rosterItem setGroups: groups];
if ([subscription isEqual: @"remove"])
[self XMPP_deleteRosterItem: rosterItem];
else
[self XMPP_addRosterItem: rosterItem];
if (isPush && [[connection delegate] respondsToSelector:
@selector(connection:didReceiveRosterItem:)])
[[connection delegate] connection: connection
didReceiveRosterItem: rosterItem];
if (isPush) {
SEL sel = @selector(connection:didReceiveRosterItem:);
[[connection XMPP_delegates]
broadcastSelector: sel
forConnection: connection
withObject: rosterItem];
}
}
if (isPush) {
[connection sendStanza: [iq resultIQ]];
} else {
if ([[connection delegate] respondsToSelector:
@selector(connectionDidReceiveRoster:)])
[[connection XMPP_delegates]
broadcastSelector: @selector(connectionDidReceiveRoster:)
[[connection delegate]
connectionDidReceiveRoster: connection];
forConnection: connection];
[rosterID release];
rosterID = nil;
}
return YES;
}
|