1 #import "JubChatClient.h"
3 @implementation JubChatClient
4 @synthesize connection;
8 - initWithConfig: (JubConfig*)config
13 connection = [XMPPConnection new];
15 connection.username = config.username;
16 connection.domain = config.domain;
17 connection.server = config.server;
18 connection.password = config.password;
19 [connection addDelegate: self];
21 roster = [[XMPPRoster alloc] initWithConnection: connection];
22 [roster addDelegate: self];
24 streamManagement = [[XMPPStreamManagement alloc]
25 initWithConnection: connection];
27 [connection asyncConnectAndHandle];
39 [streamManagement release];
45 - (void)connection: (XMPPConnection*)conn_
46 wasBoundToJID: (XMPPJID*)jid
48 of_log(@"Bound to JID: %@", [jid fullJID]);
50 [roster requestRoster];
53 - (void)rosterWasReceived: (XMPPRoster*)roster
55 [connection sendStanza: [XMPPPresence presence]];