X-Git-Url: http://cgit.babelmonkeys.de/?a=blobdiff_plain;f=src%2Fcore%2FJubChatClient.m;h=fa4bd9e0aa2309957810b6e85f711c7296a9f0ef;hb=HEAD;hp=1d7874ad563d26c044f5b9d100651c0505deb94f;hpb=1a38d433f22f577feb4007160d7a591b00518c9f;p=jubjub.git diff --git a/src/core/JubChatClient.m b/src/core/JubChatClient.m index 1d7874a..fa4bd9e 100644 --- a/src/core/JubChatClient.m +++ b/src/core/JubChatClient.m @@ -1,11 +1,14 @@ #import "JubChatClient.h" #import "ObjXMPP/namespaces.h" +#import "JubAvatarManager.h" + #define JUB_CLIENT_URI @"http://babelmonkeys.de/jubjub" @implementation JubChatClient @synthesize connection = _connection; @synthesize roster = _roster; +@synthesize avatarManager = _avatarManager; @synthesize contactManager = _contactManager; @synthesize discoEntity = _discoEntity; @synthesize presence = _presence; @@ -28,6 +31,20 @@ _roster = [[XMPPRoster alloc] initWithConnection: _connection]; [_roster addDelegate: self]; + _discoEntity = + [[XMPPDiscoEntity alloc] initWithConnection: _connection + capsNode: JUB_CLIENT_URI]; + + XMPPDiscoIdentity *identity = + [XMPPDiscoIdentity identityWithCategory: @"client" + type: @"pc" + name: @"JubJub"]; + [_discoEntity addIdentity: identity]; + [_discoEntity addFeature: XMPP_NS_CAPS]; + + _avatarManager = + [[JubAvatarManager alloc] initWithClient: self]; + _contactManager = [[XMPPContactManager alloc] initWithConnection: _connection roster: _roster]; @@ -53,6 +70,7 @@ [_contactManager release]; [_discoEntity release]; [_streamManagement release]; + [_avatarManager release]; [_connection release]; [_presence release]; [_chatMap release]; @@ -133,19 +151,6 @@ - (void)connection: (XMPPConnection*)connection wasBoundToJID: (XMPPJID*)jid { - of_log(@"Bound to JID: %@", [jid fullJID]); - - _discoEntity = - [[XMPPDiscoEntity alloc] initWithConnection: connection - capsNode: JUB_CLIENT_URI]; - - XMPPDiscoIdentity *identity = - [XMPPDiscoIdentity identityWithCategory: @"client" - type: @"pc" - name: @"JubJub"]; - [_discoEntity addIdentity: identity]; - [_discoEntity addFeature: XMPP_NS_CAPS]; - [_roster requestRoster]; } @@ -155,7 +160,7 @@ if ([presence.from isEqual: connection.JID]) { [_ui client: self didChangePresence: presence]; - OF_SETTER(_presence, presence, YES, 0); + OF_SETTER(_presence, presence, true, 0); } }