@@ -30,10 +30,11 @@ #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" #import "XMPPRoster.h" +#import "XMPPJSONFileStorage.h" @interface AppDelegate: OFObject #ifdef OF_HAVE_OPTIONAL_PROTOCOLS #endif @@ -90,14 +91,19 @@ assert([[elem XMLString] isEqual: [stanza XMLString]]); assert(([[OFString stringWithFormat: @"%@, %@, %@, %@", [[stanza from] fullJID], [[stanza to] fullJID], [stanza type], [stanza ID]] isEqual: @"bob@localhost, alice@localhost, get, 42"])); - conn = [[XMPPConnection alloc] init]; - roster = [[XMPPRoster alloc] initWithConnection: conn]; + conn = [[XMPPConnection alloc] init]; [conn addDelegate: self]; + + XMPPJSONFileStorage *storage = + [[XMPPJSONFileStorage alloc] initWithFile: @"storage.json"]; + [conn setDataStorage: storage]; + + roster = [[XMPPRoster alloc] initWithConnection: conn]; [roster addDelegate: self]; if ([arguments count] != 3) { of_log(@"Invalid count of command line arguments!"); [OFApplication terminateWithStatus: 1];