]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/core/main.m
Use -[asyncConnectAndHandle]
[jubjub.git] / src / core / main.m
index ff97a3b602b56b98e01f071e7c3040923f23e912..62393b23ed964dd7e22bbdd2ed1fdba787a8908a 100644 (file)
@@ -18,6 +18,8 @@ OF_APPLICATION_DELEGATE(AppDelegate)
 - (void)applicationDidFinishLaunching
 {
        ui = [[JubGtkUI alloc] init];
+       id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate =
+           [ui rosterDelegate];
 
        connection = [[XMPPConnection alloc] init];
        [connection addDelegate: self];
@@ -26,13 +28,12 @@ OF_APPLICATION_DELEGATE(AppDelegate)
        connection.username = @"alice";
        connection.password = @"test";
 
-       [connection connect];
-       [connection handleConnection];
+       [connection asyncConnectAndHandle];
 
-       [connection addDelegate: [ui rosterDelegate]];
+       [connection addDelegate: rosterDelegate];
 
        roster = [[XMPPRoster alloc] initWithConnection: connection];
-       [roster addDelegate: [ui rosterDelegate]];
+       [roster addDelegate: rosterDelegate];
        [roster addDelegate: self];
 
        [ui startUIThread];