]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/core/main.m
Open new chat windows when activating a roster row
[jubjub.git] / src / core / main.m
index 62393b23ed964dd7e22bbdd2ed1fdba787a8908a..c01a5ccecfe3da16797eff965ab93177e74e0f93 100644 (file)
@@ -17,9 +17,7 @@ OF_APPLICATION_DELEGATE(AppDelegate)
 @implementation AppDelegate
 - (void)applicationDidFinishLaunching
 {
-       ui = [[JubGtkUI alloc] init];
-       id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate =
-           [ui rosterDelegate];
+       id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate;
 
        connection = [[XMPPConnection alloc] init];
        [connection addDelegate: self];
@@ -28,7 +26,8 @@ OF_APPLICATION_DELEGATE(AppDelegate)
        connection.username = @"alice";
        connection.password = @"test";
 
-       [connection asyncConnectAndHandle];
+       ui = [[JubGtkUI alloc] initWithConnection: connection];
+       rosterDelegate = [ui rosterDelegate];
 
        [connection addDelegate: rosterDelegate];
 
@@ -36,6 +35,8 @@ OF_APPLICATION_DELEGATE(AppDelegate)
        [roster addDelegate: rosterDelegate];
        [roster addDelegate: self];
 
+       [connection asyncConnectAndHandle];
+
        [ui startUIThread];
 }