]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/core/main.m
Split GTK roster delegate into separate class
[jubjub.git] / src / core / main.m
index ff97a3b602b56b98e01f071e7c3040923f23e912..6b03d9565f4563b6e2e46b0eee654d460d5049c0 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];
@@ -29,10 +31,10 @@ OF_APPLICATION_DELEGATE(AppDelegate)
        [connection connect];
        [connection handleConnection];
 
-       [connection addDelegate: [ui rosterDelegate]];
+       [connection addDelegate: rosterDelegate];
 
        roster = [[XMPPRoster alloc] initWithConnection: connection];
-       [roster addDelegate: [ui rosterDelegate]];
+       [roster addDelegate: rosterDelegate];
        [roster addDelegate: self];
 
        [ui startUIThread];