]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/core/JubChatClient.m
Add User Avatar support
[jubjub.git] / src / core / JubChatClient.m
index 1d7874ad563d26c044f5b9d100651c0505deb94f..3184b8970dd08e5e914aaa61c7d5bfef29d72de4 100644 (file)
@@ -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;
                _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];
 - (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];
 }