forked from bbrosemer/BBFacebookiOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXMPPModule.m
More file actions
executable file
·48 lines (35 loc) · 877 Bytes
/
XMPPModule.m
File metadata and controls
executable file
·48 lines (35 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#import "XMPPModule.h"
#import "XMPPStream.h"
#import "MulticastDelegate.h"
@implementation XMPPModule
@synthesize xmppStream;
- (id)initWithStream:(XMPPStream *)aXmppStream
{
if ((self = [super init]))
{
xmppStream = [aXmppStream retain];
[xmppStream addDelegate:self];
multicastDelegate = [[MulticastDelegate alloc] init];
// The LAST thing we do is register our module with the xmpp stream.
// We MUST do this AFTER initializing our multicast delegate.
[xmppStream registerModule:self];
}
return self;
}
- (void)dealloc
{
[xmppStream unregisterModule:self];
[xmppStream removeDelegate:self];
[xmppStream release];
[multicastDelegate release];
[super dealloc];
}
- (void)addDelegate:(id)delegate
{
[multicastDelegate addDelegate:delegate];
}
- (void)removeDelegate:(id)delegate
{
[multicastDelegate removeDelegate:delegate];
}
@end