From 9ae39edeb4dd502344513a014e58356b6bed1e87 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 23 Jun 2013 23:41:47 +0200 Subject: [PATCH] Use instancetype. --- src/XMPPCallback.h | 6 +++--- src/XMPPCallback.m | 6 +++--- src/XMPPConnection.h | 2 +- src/XMPPConnection.m | 2 +- src/XMPPDiscoEntity.h | 6 +++--- src/XMPPDiscoEntity.m | 6 +++--- src/XMPPDiscoIdentity.h | 10 +++++----- src/XMPPDiscoIdentity.m | 10 +++++----- src/XMPPDiscoNode.h | 8 ++++---- src/XMPPDiscoNode.m | 10 +++++----- src/XMPPEXTERNALAuth.h | 4 ++-- src/XMPPEXTERNALAuth.m | 4 ++-- src/XMPPExceptions.h | 24 ++++++++++++------------ src/XMPPExceptions.m | 24 ++++++++++++------------ src/XMPPIQ.h | 4 ++-- src/XMPPIQ.m | 4 ++-- src/XMPPJID.h | 4 ++-- src/XMPPJID.m | 4 ++-- src/XMPPMessage.h | 10 +++++----- src/XMPPMessage.m | 8 ++++---- src/XMPPPLAINAuth.h | 8 ++++---- src/XMPPPLAINAuth.m | 10 +++++----- src/XMPPPresence.h | 10 +++++----- src/XMPPPresence.m | 10 +++++----- src/XMPPRosterItem.h | 2 +- src/XMPPRosterItem.m | 2 +- src/XMPPSCRAMAuth.h | 22 +++++++++++----------- src/XMPPSCRAMAuth.m | 22 +++++++++++----------- src/XMPPSRVLookup.h | 14 +++++++------- src/XMPPSRVLookup.m | 14 +++++++------- src/XMPPStanza.h | 18 +++++++++--------- src/XMPPStanza.m | 18 +++++++++--------- 32 files changed, 153 insertions(+), 153 deletions(-) diff --git a/src/XMPPCallback.h b/src/XMPPCallback.h index 41568bf..a9e01ae 100644 --- a/src/XMPPCallback.h +++ b/src/XMPPCallback.h @@ -39,12 +39,12 @@ typedef void (^xmpp_callback_block_t)(XMPPConnection*, XMPPIQ*); } #ifdef OF_HAVE_BLOCKS -+ callbackWithBlock: (xmpp_callback_block_t)callback; ++ (instancetype)callbackWithBlock: (xmpp_callback_block_t)callback; - initWithBlock: (xmpp_callback_block_t)callback; #endif -+ callbackWithTarget: (id)target - selector: (SEL)selector; ++ (instancetype)callbackWithTarget: (id)target + selector: (SEL)selector; - initWithTarget: (id)target selector: (SEL)selector; diff --git a/src/XMPPCallback.m b/src/XMPPCallback.m index edd5536..7438a0b 100644 --- a/src/XMPPCallback.m +++ b/src/XMPPCallback.m @@ -28,7 +28,7 @@ @implementation XMPPCallback #ifdef OF_HAVE_BLOCKS -+ callbackWithBlock: (xmpp_callback_block_t)block ++ (instancetype)callbackWithBlock: (xmpp_callback_block_t)block { return [[(XMPPCallback*)[self alloc] initWithBlock: block] autorelease]; } @@ -48,8 +48,8 @@ } #endif -+ callbackWithTarget: (id)target - selector: (SEL)selector ++ (instancetype)callbackWithTarget: (id)target + selector: (SEL)selector { return [[[self alloc] initWithTarget: target selector: selector] autorelease]; diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index bbad8d2..1ef947f 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -218,7 +218,7 @@ * * \return A new autoreleased XMPPConnection */ -+ connection; ++ (instancetype)connection; /** * \brief Adds the specified delegate. diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index c7b4151..786d13d 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -117,7 +117,7 @@ @end @implementation XMPPConnection -+ connection ++ (instancetype)connection { return [[[self alloc] init] autorelease]; } diff --git a/src/XMPPDiscoEntity.h b/src/XMPPDiscoEntity.h index d986963..b941091 100644 --- a/src/XMPPDiscoEntity.h +++ b/src/XMPPDiscoEntity.h @@ -58,7 +58,7 @@ * \param connection The XMPPConnection to serve responses on. * \return A new autoreleased XMPPDiscoEntity */ -+ discoEntityWithConnection: (XMPPConnection*)connection; ++ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection; /** * \brief Creates a new autoreleased XMPPDiscoEntity with the specified @@ -68,8 +68,8 @@ * \param capsNode The node advertised for the entity's capabilites * \return A new autoreleased XMPPDiscoEntity */ -+ discoEntityWithConnection: (XMPPConnection*)connection - capsNode: (OFString*)capsNode; ++ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection + capsNode: (OFString*)capsNode; /** * \brief Initializes an already allocated XMPPDiscoEntity with the specified diff --git a/src/XMPPDiscoEntity.m b/src/XMPPDiscoEntity.m index c2b42ee..bd434d5 100644 --- a/src/XMPPDiscoEntity.m +++ b/src/XMPPDiscoEntity.m @@ -26,13 +26,13 @@ #import "namespaces.h" @implementation XMPPDiscoEntity -+ discoEntityWithConnection: (XMPPConnection*)connection ++ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection { return [[[self alloc] initWithConnection: connection] autorelease]; } -+ discoEntityWithConnection: (XMPPConnection*)connection - capsNode: (OFString*)capsNode ++ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection + capsNode: (OFString*)capsNode { return [[[self alloc] initWithConnection: connection capsNode: capsNode] autorelease]; diff --git a/src/XMPPDiscoIdentity.h b/src/XMPPDiscoIdentity.h index abe09fc..c02fcbd 100644 --- a/src/XMPPDiscoIdentity.h +++ b/src/XMPPDiscoIdentity.h @@ -47,9 +47,9 @@ * \param name The name of the identity * \return A new autoreleased XMPPDiscoIdentity */ -+ identityWithCategory: (OFString*)category - type: (OFString*)type - name: (OFString*)name; ++ (instancetype)identityWithCategory: (OFString*)category + type: (OFString*)type + name: (OFString*)name; /** * \brief Creates a new autoreleased XMPPDiscoIdentity with the specified @@ -59,8 +59,8 @@ * \param type The type of the identity * \return A new autoreleased XMPPDiscoIdentity */ -+ identityWithCategory: (OFString*)category - type: (OFString*)type; ++ (instancetype)identityWithCategory: (OFString*)category + type: (OFString*)type; /** * \brief Initializes an already allocated XMPPDiscoIdentity with the specified diff --git a/src/XMPPDiscoIdentity.m b/src/XMPPDiscoIdentity.m index af5d042..e8e8aab 100644 --- a/src/XMPPDiscoIdentity.m +++ b/src/XMPPDiscoIdentity.m @@ -23,17 +23,17 @@ #import "XMPPDiscoIdentity.h" @implementation XMPPDiscoIdentity -+ identityWithCategory: (OFString*)category - type: (OFString*)type - name: (OFString*)name ++ (instancetype)identityWithCategory: (OFString*)category + type: (OFString*)type + name: (OFString*)name { return [[[self alloc] initWithCategory: category type: type name: name] autorelease]; } -+ identityWithCategory: (OFString*)category - type: (OFString*)type ++ (instancetype)identityWithCategory: (OFString*)category + type: (OFString*)type { return [[[self alloc] initWithCategory: category type: type] autorelease]; diff --git a/src/XMPPDiscoNode.h b/src/XMPPDiscoNode.h index 4465a7b..adaedaf 100644 --- a/src/XMPPDiscoNode.h +++ b/src/XMPPDiscoNode.h @@ -61,8 +61,8 @@ * \param node The node's opaque name * \return A new autoreleased XMPPDiscoNode */ -+ discoNodeWithJID: (XMPPJID*)JID - node: (OFString*)node; ++ (instancetype)discoNodeWithJID: (XMPPJID*)JID + node: (OFString*)node; /** * \brief Creates a new autoreleased XMPPDiscoNode with the specified @@ -73,8 +73,8 @@ * \param name The node's human friendly name * \return A new autoreleased XMPPDiscoNode */ -+ discoNodeWithJID: (XMPPJID*)JID - node: (OFString*)node ++ (instancetype)discoNodeWithJID: (XMPPJID*)JID + node: (OFString*)node name: (OFString*)name; /** diff --git a/src/XMPPDiscoNode.m b/src/XMPPDiscoNode.m index 320915b..59b1096 100644 --- a/src/XMPPDiscoNode.m +++ b/src/XMPPDiscoNode.m @@ -28,17 +28,17 @@ #import "namespaces.h" @implementation XMPPDiscoNode -+ discoNodeWithJID: (XMPPJID*)JID - node: (OFString*)node; ++ (instancetype)discoNodeWithJID: (XMPPJID*)JID + node: (OFString*)node; { return [[[self alloc] initWithJID: JID node: node] autorelease]; } -+ discoNodeWithJID: (XMPPJID*)JID - node: (OFString*)node - name: (OFString*)name ++ (instancetype)discoNodeWithJID: (XMPPJID*)JID + node: (OFString*)node + name: (OFString*)name { return [[[self alloc] initWithJID: JID node: node diff --git a/src/XMPPEXTERNALAuth.h b/src/XMPPEXTERNALAuth.h index bd21fd4..4a8a032 100644 --- a/src/XMPPEXTERNALAuth.h +++ b/src/XMPPEXTERNALAuth.h @@ -32,7 +32,7 @@ * * \return A new autoreleased XMPPEXTERNALAuth */ -+ EXTERNALAuth; ++ (instancetype)EXTERNALAuth; /** * \brief Creates a new autoreleased XMPPEXTERNALAuth with an authzid. @@ -40,5 +40,5 @@ * \param authzid The authzid to get authorization for * \return A new autoreleased XMPPEXTERNALAuth */ -+ EXTERNALAuthWithAuthzid: (OFString*)authzid; ++ (instancetype)EXTERNALAuthWithAuthzid: (OFString*)authzid; @end diff --git a/src/XMPPEXTERNALAuth.m b/src/XMPPEXTERNALAuth.m index 2db03d4..703697a 100644 --- a/src/XMPPEXTERNALAuth.m +++ b/src/XMPPEXTERNALAuth.m @@ -27,13 +27,13 @@ #import "XMPPEXTERNALAuth.h" @implementation XMPPEXTERNALAuth: XMPPAuthenticator -+ EXTERNALAuth ++ (instancetype)EXTERNALAuth { return [[[self alloc] initWithAuthcid: nil password: nil] autorelease]; } -+ EXTERNALAuthWithAuthzid: (OFString*)authzid ++ (instancetype)EXTERNALAuthWithAuthzid: (OFString*)authzid { return [[[self alloc] initWithAuthzid: authzid authcid: nil diff --git a/src/XMPPExceptions.h b/src/XMPPExceptions.h index 002ac9a..a795fe3 100644 --- a/src/XMPPExceptions.h +++ b/src/XMPPExceptions.h @@ -45,7 +45,7 @@ * for this exception * \return A new XMPPException */ -+ exceptionWithConnection: (XMPPConnection*)connection; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection; /** * \brief Initializes an already allocated XMPPException. @@ -82,9 +82,9 @@ * \param reason The descriptive free-form text specified by the stream error * \return A new XMPPStreamErrorException */ -+ exceptionWithConnection: (XMPPConnection*)connection - condition: (OFString*)condition - reason: (OFString*)reason; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + condition: (OFString*)condition + reason: (OFString*)reason; /** * \brief Initializes an already allocated XMPPStreamErrorException. @@ -126,9 +126,9 @@ * \param string The string that failed the stringprep profile * \return A new XMPPStringPrepFailedException */ -+ exceptionWithConnection: (XMPPConnection*)connection - profile: (OFString*)profile - string: (OFString*)string; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + profile: (OFString*)profile + string: (OFString*)string; /** * \brief Initializes an already allocated XMPPStringPrepFailedException. @@ -169,9 +169,9 @@ * \param string The string that could not be translated * \return A new XMPPIDNATranslationFailedException */ -+ exceptionWithConnection: (XMPPConnection*)connection - operation: (OFString*)operation - string: (OFString*)string; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + operation: (OFString*)operation + string: (OFString*)string; /** * \brief Initializes an already allocated XMPPIDNATranslationFailedException. @@ -209,8 +209,8 @@ * \param reason The reason the authentication failed * \return A new XMPPAuthFailedException */ -+ exceptionWithConnection: (XMPPConnection*)connection - reason: (OFString*)reason; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + reason: (OFString*)reason; /** * \brief Initializes an already allocated XMPPAuthFailedException. diff --git a/src/XMPPExceptions.m b/src/XMPPExceptions.m index 9d7146f..e170cba 100644 --- a/src/XMPPExceptions.m +++ b/src/XMPPExceptions.m @@ -30,7 +30,7 @@ #import "XMPPConnection.h" @implementation XMPPException -+ exceptionWithConnection: (XMPPConnection*)connection ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection { return [[[self alloc] initWithConnection: connection] autorelease]; } @@ -75,9 +75,9 @@ @end @implementation XMPPStreamErrorException -+ exceptionWithConnection: (XMPPConnection*)connection - condition: (OFString*)condition - reason: (OFString*)reason; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + condition: (OFString*)condition + reason: (OFString*)reason; { return [[[self alloc] initWithConnection: connection condition: condition @@ -139,9 +139,9 @@ @end @implementation XMPPStringPrepFailedException -+ exceptionWithConnection: (XMPPConnection*)connection - profile: (OFString*)profile - string: (OFString*)string ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + profile: (OFString*)profile + string: (OFString*)string { return [[[self alloc] initWithConnection: connection profile: profile @@ -204,9 +204,9 @@ @end @implementation XMPPIDNATranslationFailedException -+ exceptionWithConnection: (XMPPConnection*)connection - operation: (OFString*)operation - string: (OFString*)string ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + operation: (OFString*)operation + string: (OFString*)string { return [[[self alloc] initWithConnection: connection operation: operation @@ -268,8 +268,8 @@ @end @implementation XMPPAuthFailedException -+ exceptionWithConnection: (XMPPConnection*)connection - reason: (OFString*)reason; ++ (instancetype)exceptionWithConnection: (XMPPConnection*)connection + reason: (OFString*)reason; { return [[[self alloc] initWithConnection: connection reason: reason] autorelease]; diff --git a/src/XMPPIQ.h b/src/XMPPIQ.h index 98524d8..07d3a69 100644 --- a/src/XMPPIQ.h +++ b/src/XMPPIQ.h @@ -34,8 +34,8 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPIQ */ -+ IQWithType: (OFString*)type - ID: (OFString*)ID; ++ (instancetype)IQWithType: (OFString*)type + ID: (OFString*)ID; /** * \brief Initializes an already allocated XMPPIQ with the specified type and diff --git a/src/XMPPIQ.m b/src/XMPPIQ.m index 7a34d8a..60bfdf8 100644 --- a/src/XMPPIQ.m +++ b/src/XMPPIQ.m @@ -29,8 +29,8 @@ #import "XMPPIQ.h" @implementation XMPPIQ -+ IQWithType: (OFString*)type - ID: (OFString*)ID ++ (instancetype)IQWithType: (OFString*)type + ID: (OFString*)ID { return [[[self alloc] initWithType: type ID: ID] autorelease]; diff --git a/src/XMPPJID.h b/src/XMPPJID.h index 90fc6c1..c745927 100644 --- a/src/XMPPJID.h +++ b/src/XMPPJID.h @@ -45,7 +45,7 @@ * * \return A new autoreleased XMPPJID */ -+ JID; ++ (instancetype)JID; /** * \brief Creates a new autoreleased XMPPJID from a string. @@ -53,7 +53,7 @@ * \param string The string to parse into a JID object * \return A new autoreleased XMPPJID */ -+ JIDWithString: (OFString*)string; ++ (instancetype)JIDWithString: (OFString*)string; /** * \brief Initializes an already allocated XMPPJID with a string. diff --git a/src/XMPPJID.m b/src/XMPPJID.m index 78a7916..fdbe823 100644 --- a/src/XMPPJID.m +++ b/src/XMPPJID.m @@ -33,12 +33,12 @@ #import "XMPPExceptions.h" @implementation XMPPJID -+ JID ++ (instancetype)JID { return [[[self alloc] init] autorelease]; } -+ JIDWithString: (OFString*)string ++ (instancetype)JIDWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } diff --git a/src/XMPPMessage.h b/src/XMPPMessage.h index 2d7ca35..fcf2493 100644 --- a/src/XMPPMessage.h +++ b/src/XMPPMessage.h @@ -37,7 +37,7 @@ * * \return A new autoreleased XMPPMessage */ -+ message; ++ (instancetype)message; /** * \brief Creates a new autoreleased XMPPMessage with the specified ID. @@ -45,7 +45,7 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPMessage */ -+ messageWithID: (OFString*)ID; ++ (instancetype)messageWithID: (OFString*)ID; /** * \brief Creates a new autoreleased XMPPMessage with the specified type. @@ -53,7 +53,7 @@ * \param type The value for the stanza's type attribute * \return A new autoreleased XMPPMessage */ -+ messageWithType: (OFString*)type; ++ (instancetype)messageWithType: (OFString*)type; /** * \brief Creates a new autoreleased XMPPMessage with the specified type and ID. @@ -62,8 +62,8 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPMessage */ -+ messageWithType: (OFString*)type - ID: (OFString*)ID; ++ (instancetype)messageWithType: (OFString*)type + ID: (OFString*)ID; /** * \brief Initializes an already allocated XMPPMessage with the specified ID. diff --git a/src/XMPPMessage.m b/src/XMPPMessage.m index 139a43a..79de84c 100644 --- a/src/XMPPMessage.m +++ b/src/XMPPMessage.m @@ -29,22 +29,22 @@ #import "namespaces.h" @implementation XMPPMessage -+ message ++ (instancetype)message { return [[[self alloc] init] autorelease]; } -+ messageWithID: (OFString*)ID ++ (instancetype)messageWithID: (OFString*)ID { return [[[self alloc] initWithID: ID] autorelease]; } -+ messageWithType: (OFString*)type ++ (instancetype)messageWithType: (OFString*)type { return [[[self alloc] initWithType: type] autorelease]; } -+ messageWithType: (OFString*)type ++ (instancetype)messageWithType: (OFString*)type ID: (OFString*)ID { return [[[self alloc] initWithType: type diff --git a/src/XMPPPLAINAuth.h b/src/XMPPPLAINAuth.h index ffe8a03..de6e113 100644 --- a/src/XMPPPLAINAuth.h +++ b/src/XMPPPLAINAuth.h @@ -34,8 +34,8 @@ * \param password The password to authenticate with * \return A new autoreleased XMPPPLAINAuth */ -+ PLAINAuthWithAuthcid: (OFString*)authcid - password: (OFString*)password; ++ (instancetype)PLAINAuthWithAuthcid: (OFString*)authcid + password: (OFString*)password; /** * \brief Creates a new autoreleased XMPPPLAINAuth with an authzid, authcid and @@ -46,7 +46,7 @@ * \param password The password to authenticate with * \return A new autoreleased XMPPPLAINAuth */ -+ PLAINAuthWithAuthzid: (OFString*)authzid - authcid: (OFString*)authcid ++ (instancetype)PLAINAuthWithAuthzid: (OFString*)authzid + authcid: (OFString*)authcid password: (OFString*)password; @end diff --git a/src/XMPPPLAINAuth.m b/src/XMPPPLAINAuth.m index 4cbec60..e899b81 100644 --- a/src/XMPPPLAINAuth.m +++ b/src/XMPPPLAINAuth.m @@ -28,16 +28,16 @@ #import "XMPPExceptions.h" @implementation XMPPPLAINAuth -+ PLAINAuthWithAuthcid: (OFString*)authcid - password: (OFString*)password ++ (instancetype)PLAINAuthWithAuthcid: (OFString*)authcid + password: (OFString*)password { return [[[self alloc] initWithAuthcid: authcid password: password] autorelease]; } -+ PLAINAuthWithAuthzid: (OFString*)authzid - authcid: (OFString*)authcid - password: (OFString*)password ++ (instancetype)PLAINAuthWithAuthzid: (OFString*)authzid + authcid: (OFString*)authcid + password: (OFString*)password { return [[[self alloc] initWithAuthzid: authzid authcid: authcid diff --git a/src/XMPPPresence.h b/src/XMPPPresence.h index 4f6f72a..66b4f81 100644 --- a/src/XMPPPresence.h +++ b/src/XMPPPresence.h @@ -42,7 +42,7 @@ * * \return A new autoreleased XMPPPresence */ -+ presence; ++ (instancetype)presence; /** * \brief Creates a new autoreleased XMPPPresence with the specified ID. @@ -50,7 +50,7 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPPresence */ -+ presenceWithID: (OFString*)ID; ++ (instancetype)presenceWithID: (OFString*)ID; /** * \brief Creates a new autoreleased XMPPPresence with the specified type. @@ -58,7 +58,7 @@ * \param type The value for the stanza's type attribute * \return A new autoreleased XMPPPresence */ -+ presenceWithType: (OFString*)type; ++ (instancetype)presenceWithType: (OFString*)type; /** * \brief Creates a new autoreleased XMPPPresence with the specified type and @@ -68,8 +68,8 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPPresence */ -+ presenceWithType: (OFString*)type - ID: (OFString*)ID; ++ (instancetype)presenceWithType: (OFString*)type + ID: (OFString*)ID; /** * \brief Initializes an already allocated XMPPPresence with the specified ID. diff --git a/src/XMPPPresence.m b/src/XMPPPresence.m index a5e7308..dad2f4b 100644 --- a/src/XMPPPresence.m +++ b/src/XMPPPresence.m @@ -43,23 +43,23 @@ static int show_to_int(OFString *show) } @implementation XMPPPresence -+ presence ++ (instancetype)presence { return [[[self alloc] init] autorelease]; } -+ presenceWithID: (OFString*)ID ++ (instancetype)presenceWithID: (OFString*)ID { return [[[self alloc] initWithID: ID] autorelease]; } -+ presenceWithType: (OFString*)type ++ (instancetype)presenceWithType: (OFString*)type { return [[[self alloc] initWithType: type] autorelease]; } -+ presenceWithType: (OFString*)type - ID: (OFString*)ID ++ (instancetype)presenceWithType: (OFString*)type + ID: (OFString*)ID { return [[[self alloc] initWithType: type ID: ID] autorelease]; diff --git a/src/XMPPRosterItem.h b/src/XMPPRosterItem.h index 8cb2dea..68bc47d 100644 --- a/src/XMPPRosterItem.h +++ b/src/XMPPRosterItem.h @@ -51,7 +51,7 @@ * * \return A new autoreleased roster item. */ -+ rosterItem; ++ (instancetype)rosterItem; - (void)setJID: (XMPPJID*)JID; - (XMPPJID*)JID; diff --git a/src/XMPPRosterItem.m b/src/XMPPRosterItem.m index f314489..5fb5e2b 100644 --- a/src/XMPPRosterItem.m +++ b/src/XMPPRosterItem.m @@ -30,7 +30,7 @@ #import @implementation XMPPRosterItem -+ rosterItem ++ (instancetype)rosterItem { return [[[self alloc] init] autorelease]; } diff --git a/src/XMPPSCRAMAuth.h b/src/XMPPSCRAMAuth.h index f612d96..4d5f198 100644 --- a/src/XMPPSCRAMAuth.h +++ b/src/XMPPSCRAMAuth.h @@ -49,11 +49,11 @@ * \param plusAvailable Whether the PLUS variant was offered * \return A new autoreleased XMPPSCRAMAuth */ -+ SCRAMAuthWithAuthcid: (OFString*)authcid - password: (OFString*)password - connection: (XMPPConnection*)connection - hash: (Class)hash - plusAvailable: (bool)plusAvailable; ++ (instancetype)SCRAMAuthWithAuthcid: (OFString*)authcid + password: (OFString*)password + connection: (XMPPConnection*)connection + hash: (Class)hash + plusAvailable: (bool)plusAvailable; /** * \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and @@ -67,12 +67,12 @@ * \param plusAvailable Whether the PLUS variant was offered * \return A new autoreleased XMPPSCRAMAuth */ -+ SCRAMAuthWithAuthzid: (OFString*)authzid - authcid: (OFString*)authcid - password: (OFString*)password - connection: (XMPPConnection*)connection - hash: (Class)hash - plusAvailable: (bool)plusAvailable; ++ (instancetype)SCRAMAuthWithAuthzid: (OFString*)authzid + authcid: (OFString*)authcid + password: (OFString*)password + connection: (XMPPConnection*)connection + hash: (Class)hash + plusAvailable: (bool)plusAvailable; /** * \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and diff --git a/src/XMPPSCRAMAuth.m b/src/XMPPSCRAMAuth.m index dc27661..4869d90 100644 --- a/src/XMPPSCRAMAuth.m +++ b/src/XMPPSCRAMAuth.m @@ -38,11 +38,11 @@ #define HMAC_OPAD 0x5c @implementation XMPPSCRAMAuth -+ SCRAMAuthWithAuthcid: (OFString*)authcid - password: (OFString*)password - connection: (XMPPConnection*)connection - hash: (Class)hash - plusAvailable: (bool)plusAvailable ++ (instancetype)SCRAMAuthWithAuthcid: (OFString*)authcid + password: (OFString*)password + connection: (XMPPConnection*)connection + hash: (Class)hash + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthcid: authcid password: password @@ -51,12 +51,12 @@ plusAvailable: plusAvailable] autorelease]; } -+ SCRAMAuthWithAuthzid: (OFString*)authzid - authcid: (OFString*)authcid - password: (OFString*)password - connection: (XMPPConnection*)connection - hash: (Class)hash - plusAvailable: (bool)plusAvailable ++ (instancetype)SCRAMAuthWithAuthzid: (OFString*)authzid + authcid: (OFString*)authcid + password: (OFString*)password + connection: (XMPPConnection*)connection + hash: (Class)hash + plusAvailable: (bool)plusAvailable { return [[[self alloc] initWithAuthzid: authzid authcid: authcid diff --git a/src/XMPPSRVLookup.h b/src/XMPPSRVLookup.h index d62465b..cab81df 100644 --- a/src/XMPPSRVLookup.h +++ b/src/XMPPSRVLookup.h @@ -43,12 +43,12 @@ @property (readonly, copy) OFString *target; #endif -+ entryWithPriority: (uint16_t)priority - weight: (uint16_t)weight - port: (uint16_t)port - target: (OFString*)target; -+ entryWithResourceRecord: (ns_rr)resourceRecord - handle: (ns_msg)handle; ++ (instancetype)entryWithPriority: (uint16_t)priority + weight: (uint16_t)weight + port: (uint16_t)port + target: (OFString*)target; ++ (instancetype)entryWithResourceRecord: (ns_rr)resourceRecord + handle: (ns_msg)handle; - initWithPriority: (uint16_t)priority weight: (uint16_t)weight port: (uint16_t)port @@ -74,7 +74,7 @@ @property (readonly, copy) OFString *domain; #endif -+ lookupWithDomain: (OFString*)domain; ++ (instancetype)lookupWithDomain: (OFString*)domain; - initWithDomain: (OFString*)domain; - (void)XMPP_lookup; diff --git a/src/XMPPSRVLookup.m b/src/XMPPSRVLookup.m index 5aab135..a38b75f 100644 --- a/src/XMPPSRVLookup.m +++ b/src/XMPPSRVLookup.m @@ -37,10 +37,10 @@ #import "XMPPSRVLookup.h" @implementation XMPPSRVEntry -+ entryWithPriority: (uint16_t)priority - weight: (uint16_t)weight - port: (uint16_t)port - target: (OFString*)target ++ (instancetype)entryWithPriority: (uint16_t)priority + weight: (uint16_t)weight + port: (uint16_t)port + target: (OFString*)target { return [[[self alloc] initWithPriority: priority weight: weight @@ -48,8 +48,8 @@ target: target] autorelease]; } -+ entryWithResourceRecord: (ns_rr)resourceRecord - handle: (ns_msg)handle ++ (instancetype)entryWithResourceRecord: (ns_rr)resourceRecord + handle: (ns_msg)handle { return [[[self alloc] initWithResourceRecord: resourceRecord handle: handle] autorelease]; @@ -163,7 +163,7 @@ @end @implementation XMPPSRVLookup -+ lookupWithDomain: (OFString*)domain ++ (instancetype)lookupWithDomain: (OFString*)domain { return [[[self alloc] initWithDomain: domain] autorelease]; } diff --git a/src/XMPPStanza.h b/src/XMPPStanza.h index 7601655..d2de1d4 100644 --- a/src/XMPPStanza.h +++ b/src/XMPPStanza.h @@ -52,7 +52,7 @@ * \param name The stanza's name (one of iq, message or presence) * \return A new autoreleased XMPPStanza */ -+ stanzaWithName: (OFString*)name; ++ (instancetype)stanzaWithName: (OFString*)name; /** * \brief Creates a new autoreleased XMPPStanza with the specified name and @@ -62,8 +62,8 @@ * \param type The value for the stanza's type attribute * \return A new autoreleased XMPPStanza */ -+ stanzaWithName: (OFString*)name - type: (OFString*)type; ++ (instancetype)stanzaWithName: (OFString*)name + type: (OFString*)type; /** * \brief Creates a new autoreleased XMPPStanza with the specified name and ID. @@ -72,8 +72,8 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPStanza */ -+ stanzaWithName: (OFString*)name - ID: (OFString*)ID; ++ (instancetype)stanzaWithName: (OFString*)name + ID: (OFString*)ID; /** * \brief Creates a new autoreleased XMPPStanza with the specified name, type @@ -84,9 +84,9 @@ * \param ID The value for the stanza's id attribute * \return A new autoreleased XMPPStanza */ -+ stanzaWithName: (OFString*)name - type: (OFString*)type - ID: (OFString*)ID; ++ (instancetype)stanzaWithName: (OFString*)name + type: (OFString*)type + ID: (OFString*)ID; /** * \brief Creates a new autoreleased XMPPStanza from an OFXMLElement. @@ -94,7 +94,7 @@ * \param element The element to base the XMPPStanza on * \return A new autoreleased XMPPStanza */ -+ stanzaWithElement: (OFXMLElement*)element; ++ (instancetype)stanzaWithElement: (OFXMLElement*)element; /** * \brief Initializes an already allocated XMPPStanza with the specified name. diff --git a/src/XMPPStanza.m b/src/XMPPStanza.m index f42307b..896708e 100644 --- a/src/XMPPStanza.m +++ b/src/XMPPStanza.m @@ -30,35 +30,35 @@ #import "namespaces.h" @implementation XMPPStanza -+ stanzaWithName: (OFString*)name ++ (instancetype)stanzaWithName: (OFString*)name { return [[[self alloc] initWithName: name] autorelease]; } -+ stanzaWithName: (OFString*)name - type: (OFString*)type ++ (instancetype)stanzaWithName: (OFString*)name + type: (OFString*)type { return [[[self alloc] initWithName: name type: type] autorelease]; } -+ stanzaWithName: (OFString*)name - ID: (OFString*)ID ++ (instancetype)stanzaWithName: (OFString*)name + ID: (OFString*)ID { return [[[self alloc] initWithName: name ID: ID] autorelease]; } -+ stanzaWithName: (OFString*)name - type: (OFString*)type - ID: (OFString*)ID ++ (instancetype)stanzaWithName: (OFString*)name + type: (OFString*)type + ID: (OFString*)ID { return [[[self alloc] initWithName: name type: type ID: ID] autorelease]; } -+ stanzaWithElement: (OFXMLElement*)element ++ (instancetype)stanzaWithElement: (OFXMLElement*)element { return [[[self alloc] initWithElement: element] autorelease]; }