]> cgit.babelmonkeys.de Git - mpdbot.git/commitdiff
Stop pretending to be Objective-C 1 compatible
authorFlorian Zeitz <florob@babelmonkeys.de>
Sun, 10 Jul 2011 21:48:22 +0000 (23:48 +0200)
committerFlorian Zeitz <florob@babelmonkeys.de>
Sun, 10 Jul 2011 21:48:22 +0000 (23:48 +0200)
src/mpdbot.m

index 1c7ab7d4ac18cdcee606e4230ada7da49953cd92..dc7689efa59f0c3750fe36d83f64a01abda889c1 100644 (file)
 
 #define NS_DISCO_INFO @"http://jabber.org/protocol/disco#info"
 
-@interface AppDelegate: OFObject
-#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
-    <OFApplicationDelegate, XMPPConnectionDelegate>
-#endif
-
+@interface AppDelegate: OFObject <OFApplicationDelegate, XMPPConnectionDelegate>
 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: %@ <server> <user> <passwd>\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;
                        }
                }