25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# include "config.h"
#endif
#define XMPP_ROSTER_M
#include <assert.h>
#import "XMPPRoster.h"
#import "XMPPRosterItem.h"
#import "XMPPConnection.h"
#import "XMPPIQ.h"
#import "XMPPJID.h"
#import "XMPPMulticastDelegate.h"
#import "namespaces.h"
|
>
>
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# include "config.h"
#endif
#define XMPP_ROSTER_M
#include <assert.h>
#import <ObjFW/OFInvalidArgumentException.h>
#import "XMPPRoster.h"
#import "XMPPRosterItem.h"
#import "XMPPConnection.h"
#import "XMPPIQ.h"
#import "XMPPJID.h"
#import "XMPPMulticastDelegate.h"
#import "namespaces.h"
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
{
return [[rosterItems copy] autorelease];
}
- (void)requestRoster
{
XMPPIQ *iq;
iq = [XMPPIQ IQWithType: @"get"
ID: [connection generateStanzaID]];
[iq addChild: [OFXMLElement elementWithName: @"query"
namespace: XMPP_NS_ROSTER]];
[connection sendIQ: iq
withCallbackObject: self
|
>
>
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
{
return [[rosterItems copy] autorelease];
}
- (void)requestRoster
{
XMPPIQ *iq;
rosterRequested = YES;
iq = [XMPPIQ IQWithType: @"get"
ID: [connection generateStanzaID]];
[iq addChild: [OFXMLElement elementWithName: @"query"
namespace: XMPP_NS_ROSTER]];
[connection sendIQ: iq
withCallbackObject: self
|
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
- (void)removeDelegate: (id <XMPPRosterDelegate>)delegate
{
[delegates removeDelegate: delegate];
}
- (void)setDataStorage: (id <XMPPStorage>)dataStorage_
{
/* TODO: Prevent changing it after it has been used */
dataStorage = dataStorage_;
}
- (id <XMPPStorage>)dataStorage
{
return dataStorage;
}
|
>
>
|
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
- (void)removeDelegate: (id <XMPPRosterDelegate>)delegate
{
[delegates removeDelegate: delegate];
}
- (void)setDataStorage: (id <XMPPStorage>)dataStorage_
{
if (rosterRequested)
@throw [OFInvalidArgumentException exceptionWithClass: isa];
dataStorage = dataStorage_;
}
- (id <XMPPStorage>)dataStorage
{
return dataStorage;
}
|