From bd1f86c153918f64cb59952ccc5ac55f40b50015 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 10 Jul 2011 23:48:22 +0200 Subject: [PATCH] Stop pretending to be Objective-C 1 compatible --- src/mpdbot.m | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/mpdbot.m b/src/mpdbot.m index 1c7ab7d..dc7689e 100644 --- a/src/mpdbot.m +++ b/src/mpdbot.m @@ -28,11 +28,7 @@ #define NS_DISCO_INFO @"http://jabber.org/protocol/disco#info" -@interface AppDelegate: OFObject -#ifdef OF_HAVE_OPTIONAL_PROTOCOLS - -#endif - +@interface AppDelegate: OFObject OFString *discoID; PEPThread *pepper; @end @@ -46,18 +42,18 @@ OF_APPLICATION_DELEGATE(AppDelegate) OFArray *arguments = [OFApplication arguments]; conn = [[XMPPConnection alloc] init]; - [conn setDelegate: self]; + conn.delegate = self; - if ([arguments count] != 3) { + if (arguments.count != 3) { [of_stdout writeFormat: @"Usage: %@ \n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } - [conn setDomain: [arguments objectAtIndex: 0]]; - [conn setUsername: [arguments objectAtIndex: 1]]; - [conn setPassword: [arguments objectAtIndex: 2]]; - [conn setResource: @"ObjXMPP"]; + conn.domain = [arguments objectAtIndex: 0]; + conn.username = [arguments objectAtIndex: 1]; + conn.password = [arguments objectAtIndex: 2]; + conn.resource = @"ObjXMPP"; @try { [conn connect]; @@ -90,8 +86,8 @@ OF_APPLICATION_DELEGATE(AppDelegate) ID: discoID]; disco.to = [XMPPJID JIDWithString: [[conn JID] bareJID]]; [disco addChild: [OFXMLElement - elementWithName: @"query" - namespace: NS_DISCO_INFO]]; + elementWithName: @"query" + namespace: NS_DISCO_INFO]]; [conn sendStanza: disco]; } @@ -101,7 +97,7 @@ OF_APPLICATION_DELEGATE(AppDelegate) { OFXMLElement *query = [iq elementForName: @"query" namespace: NS_DISCO_INFO]; - if ([[iq ID] isEqual: discoID]) { + if ([iq.ID isEqual: discoID]) { for (OFXMLElement *identity in [query elementsForName: @"identity" namespace: NS_DISCO_INFO]) { @@ -112,6 +108,7 @@ OF_APPLICATION_DELEGATE(AppDelegate) pepper = [[PEPThread alloc] initWithObject: conn]; [pepper start]; + return YES; } } -- 2.39.2