@@ -30,11 +30,11 @@ #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" -@interface AppDelegate: OFObject +@interface AppDelegate: OFObject { XMPPConnection *conn; } @end @@ -82,10 +82,11 @@ assert(([[OFString stringWithFormat: @"%@, %@, %@, %@", stanza.from.fullJID, stanza.to.fullJID, stanza.type, stanza.ID] isEqual: @"bob@localhost, alice@localhost, get, 42"])); conn = [[XMPPConnection alloc] init]; + conn.delegate = self; if (arguments.count != 3) { of_log(@"Invalid count of command line arguments!"); [OFApplication terminateWithStatus: 1]; } @@ -101,6 +102,29 @@ [conn handleConnection]; } @catch (id e) { of_log(@"%@", e); } } + +- (void)connectionWasClosed: (XMPPConnection*)conn +{ + of_log(@"Connection was closed!"); +} + +- (void)connection: (XMPPConnection*)conn + didReceiveIQ: (XMPPIQ*)iq +{ + of_log(@"IQ: %@", iq); +} + +- (void)connection: (XMPPConnection*)conn + didReceiveMessage: (XMPPMessage*)msg +{ + of_log(@"Message: %@", msg); +} + +- (void)connection: (XMPPConnection*)conn + didReceivePresence: (XMPPPresence*)pres +{ + of_log(@"Presence: %@", pres); +} @end