]> cgit.babelmonkeys.de Git - jubjub.git/blobdiff - src/core/main.m
Add basic config file support
[jubjub.git] / src / core / main.m
index c01a5ccecfe3da16797eff965ab93177e74e0f93..9ec84951de2042dbace938b3e7411768e11e2efe 100644 (file)
@@ -2,6 +2,7 @@
 #import <ObjXMPP/ObjXMPP.h>
 
 #import "JubGtkUI.h"
+#import "JubConfig.h"
 
 @interface AppDelegate: OFObject
     <OFApplicationDelegate, XMPPConnectionDelegate, XMPPRosterDelegate>
@@ -18,13 +19,15 @@ OF_APPLICATION_DELEGATE(AppDelegate)
 - (void)applicationDidFinishLaunching
 {
        id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate;
+       JubConfig *config = [[JubConfig alloc] initWithFile: @"config.xml"];
 
        connection = [[XMPPConnection alloc] init];
        [connection addDelegate: self];
 
-       connection.domain = @"localhost";
-       connection.username = @"alice";
-       connection.password = @"test";
+       connection.domain = config.domain;
+       connection.server = config.server;
+       connection.username = config.username;
+       connection.password = config.password;
 
        ui = [[JubGtkUI alloc] initWithConnection: connection];
        rosterDelegate = [ui rosterDelegate];