Change documentation style to ObjFW's style
This commit is contained in:
parent
631b4e1a9d
commit
8c991b50d2
19 changed files with 750 additions and 613 deletions
|
@ -25,57 +25,65 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A base class for classes implementing authentication mechanisms
|
||||
/*!
|
||||
* @brief A base class for classes implementing authentication mechanisms
|
||||
*/
|
||||
@interface XMPPAuthenticator: OFObject
|
||||
{
|
||||
OFString *_authzid, *_authcid, *_password;
|
||||
}
|
||||
|
||||
/// \brief The authzid to get authorization for
|
||||
/*!
|
||||
* The authzid to get authorization for.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *authzid;
|
||||
/// \brief The authcid to authenticate with
|
||||
|
||||
/*!
|
||||
* The authcid to authenticate with.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *authcid;
|
||||
/// \brief The password to authenticate with
|
||||
|
||||
/*!
|
||||
* The password to authenticate with.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *password;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPAuthenticator with an authcid
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPAuthenticator with an authcid
|
||||
* and password.
|
||||
*
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \return A initialized XMPPAuthenticator
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @return A initialized XMPPAuthenticator
|
||||
*/
|
||||
- initWithAuthcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPSCRAMAuthenticator with an
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPSCRAMAuthenticator with an
|
||||
* authzid, authcid and password.
|
||||
*
|
||||
* \param authzid The authzid to get authorization for
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \return A initialized XMPPAuthenticator
|
||||
* @param authzid The authzid to get authorization for
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @return A initialized XMPPAuthenticator
|
||||
*/
|
||||
- initWithAuthzid: (nullable OFString *)authzid
|
||||
authcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password OF_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* \brief Returns OFData containing the initial authentication message.
|
||||
/*!
|
||||
* @brief Returns OFData containing the initial authentication message.
|
||||
*
|
||||
* \return An OFDataAray containing the initial authentication message
|
||||
* @return An OFDataAray containing the initial authentication message
|
||||
*/
|
||||
- (nullable OFData *)initialMessage;
|
||||
|
||||
/**
|
||||
* \brief Continue authentication with the specified data.
|
||||
/*!
|
||||
* @brief Continue authentication with the specified data.
|
||||
*
|
||||
* \param data The continuation data send by the server
|
||||
* \return The appropriate response if the data was a challenge, nil otherwise
|
||||
* @param data The continuation data send by the server
|
||||
* @return The appropriate response if the data was a challenge, nil otherwise
|
||||
*/
|
||||
- (nullable OFData *)continueWithData: (OFData *)data;
|
||||
@end
|
||||
|
|
|
@ -38,78 +38,78 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class SSLSocket;
|
||||
@class XMPPMulticastDelegate;
|
||||
|
||||
/**
|
||||
* \brief A protocol that should be (partially) implemented by delegates of a
|
||||
/*!
|
||||
* @brief A protocol that should be (partially) implemented by delegates of a
|
||||
* @ref XMPPConnection
|
||||
*/
|
||||
@protocol XMPPConnectionDelegate
|
||||
@optional
|
||||
/**
|
||||
* \brief This callback is called when the connection received an element.
|
||||
/*!
|
||||
* @brief This callback is called when the connection received an element.
|
||||
*
|
||||
* \param connection The connection that received the element
|
||||
* \param element The element that was received
|
||||
* @param connection The connection that received the element
|
||||
* @param element The element that was received
|
||||
*/
|
||||
- (void)connection: (XMPPConnection *)connection
|
||||
didReceiveElement: (OFXMLElement *)element;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection sent an element.
|
||||
/*!
|
||||
* @brief This callback is called when the connection sent an element.
|
||||
*
|
||||
* \param connection The connection that sent the element
|
||||
* \param element The element that was sent
|
||||
* @param connection The connection that sent the element
|
||||
* @param element The element that was sent
|
||||
*/
|
||||
- (void)connection: (XMPPConnection *)connection
|
||||
didSendElement: (OFXMLElement *)element;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection sucessfully authenticated.
|
||||
/*!
|
||||
* @brief This callback is called when the connection sucessfully authenticated.
|
||||
*
|
||||
* \param connection The connection that was authenticated
|
||||
* @param connection The connection that was authenticated
|
||||
*/
|
||||
- (void)connectionWasAuthenticated: (XMPPConnection *)connection;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection was bound to a JID.
|
||||
/*!
|
||||
* @brief This callback is called when the connection was bound to a JID.
|
||||
*
|
||||
* \param connection The connection that was bound to a JID
|
||||
* \param JID The JID the conecction was bound to
|
||||
* @param connection The connection that was bound to a JID
|
||||
* @param JID The JID the conecction was bound to
|
||||
*/
|
||||
- (void)connection: (XMPPConnection *)connection
|
||||
wasBoundToJID: (XMPPJID *)JID;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection received an IQ stanza.
|
||||
/*!
|
||||
* @brief This callback is called when the connection received an IQ stanza.
|
||||
*
|
||||
* \param connection The connection that received the stanza
|
||||
* \param iq The IQ stanza that was received
|
||||
* @param connection The connection that received the stanza
|
||||
* @param iq The IQ stanza that was received
|
||||
*/
|
||||
- (bool)connection: (XMPPConnection *)connection
|
||||
didReceiveIQ: (XMPPIQ *)iq;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection received a presence
|
||||
/*!
|
||||
* @brief This callback is called when the connection received a presence
|
||||
* stanza.
|
||||
*
|
||||
* \param connection The connection that received the stanza
|
||||
* \param presence The presence stanza that was received
|
||||
* @param connection The connection that received the stanza
|
||||
* @param presence The presence stanza that was received
|
||||
*/
|
||||
- (void)connection: (XMPPConnection *)connection
|
||||
didReceivePresence: (XMPPPresence *)presence;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection received a message stanza.
|
||||
/*!
|
||||
* @brief This callback is called when the connection received a message stanza.
|
||||
*
|
||||
* \param connection The connection that received the stanza
|
||||
* \param message The message stanza that was received
|
||||
* @param connection The connection that received the stanza
|
||||
* @param message The message stanza that was received
|
||||
*/
|
||||
- (void)connection: (XMPPConnection *)connection
|
||||
didReceiveMessage: (XMPPMessage *)message;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection was closed.
|
||||
/*!
|
||||
* @brief This callback is called when the connection was closed.
|
||||
*
|
||||
* \param connection The connection that was closed
|
||||
* @param connection The connection that was closed
|
||||
*/
|
||||
- (void)connectionWasClosed: (XMPPConnection *)connection;
|
||||
|
||||
|
@ -125,24 +125,24 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
- (void)connection: (XMPPConnection *)connection
|
||||
didThrowException: (OFException *)exception;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection is about to upgrade to
|
||||
/*!
|
||||
* @brief This callback is called when the connection is about to upgrade to
|
||||
* TLS.
|
||||
*
|
||||
* \param connection The connection that will upgraded to TLS
|
||||
* @param connection The connection that will upgraded to TLS
|
||||
*/
|
||||
- (void)connectionWillUpgradeToTLS: (XMPPConnection *)connection;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when the connection was upgraded to use TLS.
|
||||
/*!
|
||||
* @brief This callback is called when the connection was upgraded to use TLS.
|
||||
*
|
||||
* \param connection The connection that was upgraded to TLS
|
||||
* @param connection The connection that was upgraded to TLS
|
||||
*/
|
||||
- (void)connectionDidUpgradeToTLS: (XMPPConnection *)connection;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief A class which abstracts a connection to an XMPP service.
|
||||
/*!
|
||||
* @brief A class which abstracts a connection to an XMPP service.
|
||||
*/
|
||||
@interface XMPPConnection: OFObject <OFXMLParserDelegate,
|
||||
OFXMLElementBuilderDelegate>
|
||||
|
@ -169,113 +169,158 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
unsigned int _lastID;
|
||||
}
|
||||
|
||||
/// \brief The username to use for authentication
|
||||
/*!
|
||||
* The username to use for authentication.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *username;
|
||||
/// \brief The password to use for authentication
|
||||
|
||||
/*!
|
||||
* The password to use for authentication.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *password;
|
||||
/**
|
||||
* \brief The server to use for the connection
|
||||
|
||||
/*!
|
||||
* The server to use for the connection.
|
||||
*
|
||||
* This is useful if the address of the server is different from the domain.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *server;
|
||||
/// \brief The domain to connect to
|
||||
|
||||
/*!
|
||||
* The domain to connect to.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *domain;
|
||||
/// \brief The resource to request for the connection
|
||||
|
||||
/*!
|
||||
* The resource to request for the connection.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *resource;
|
||||
/// \brief The language to request for the connection
|
||||
|
||||
/*!
|
||||
* The language to request for the connection.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *language;
|
||||
/// \brief A private key file to use for authentication
|
||||
|
||||
/*!
|
||||
* A private key file to use for authentication.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *privateKeyFile;
|
||||
/// \brief A certificate file to use for authentication
|
||||
|
||||
/*!
|
||||
* A certificate file to use for authentication.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *certificateFile;
|
||||
/// \brief The JID the server assigned to the connection after binding
|
||||
|
||||
/*!
|
||||
* The JID the server assigned to the connection after binding.
|
||||
*/
|
||||
@property (readonly, nonatomic) XMPPJID *JID;
|
||||
/// \brief The port to connect to
|
||||
|
||||
/*!
|
||||
* The port to connect to.
|
||||
*/
|
||||
@property uint16_t port;
|
||||
/// \brief An object for data storage, conforming to the XMPPStorage protocol
|
||||
|
||||
/*!
|
||||
* An object for data storage, conforming to the XMPPStorage protocol.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (assign) id <XMPPStorage> dataStorage;
|
||||
/// \brief The socket used for the connection
|
||||
|
||||
/*!
|
||||
* The socket used for the connection.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFTCPSocket *socket;
|
||||
/// \brief Whether encryption is required
|
||||
|
||||
/*!
|
||||
* Whether encryption is required.
|
||||
*/
|
||||
@property bool encryptionRequired;
|
||||
/// \brief Whether the connection is encrypted
|
||||
|
||||
/*!
|
||||
* Whether the connection is encrypted.
|
||||
*/
|
||||
@property (readonly) bool encrypted;
|
||||
/// \brief Whether roster versioning is supported
|
||||
|
||||
/*!
|
||||
* Whether roster versioning is supported.
|
||||
*/
|
||||
@property (readonly) bool supportsRosterVersioning;
|
||||
/// \brief Whether stream management is supported
|
||||
|
||||
/*!
|
||||
* Whether stream management is supported.
|
||||
*/
|
||||
@property (readonly) bool supportsStreamManagement;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPConnection.
|
||||
/*!
|
||||
* Creates a new autoreleased XMPPConnection.
|
||||
*
|
||||
* \return A new autoreleased XMPPConnection
|
||||
* @return A new autoreleased XMPPConnection
|
||||
*/
|
||||
+ (instancetype)connection;
|
||||
|
||||
/**
|
||||
* \brief Adds the specified delegate.
|
||||
/*!
|
||||
* @brief Adds the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to add
|
||||
* @param delegate The delegate to add
|
||||
*/
|
||||
- (void)addDelegate: (id <XMPPConnectionDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* \brief Removes the specified delegate.
|
||||
/*!
|
||||
* @brief Removes the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to remove
|
||||
* @param delegate The delegate to remove
|
||||
*/
|
||||
- (void)removeDelegate: (id <XMPPConnectionDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* \brief Connects to the XMPP service.
|
||||
/*!
|
||||
* @brief Connects to the XMPP service.
|
||||
*/
|
||||
- (void)connect;
|
||||
|
||||
/**
|
||||
* \brief Closes the stream to the XMPP service
|
||||
/*!
|
||||
* @brief Closes the stream to the XMPP service
|
||||
*/
|
||||
- (void)close;
|
||||
|
||||
/**
|
||||
* \brief Checks the certificate presented by the server and sets the specified
|
||||
/*!
|
||||
* @brief Checks the certificate presented by the server and sets the specified
|
||||
* pointer to the reason why the certificate is not valid
|
||||
*
|
||||
* \param reason A pointer to an OFString which is set to a reason in case the
|
||||
* @param reason A pointer to an OFString which is set to a reason in case the
|
||||
* certificate is not valid (otherwise, it does not touch it).
|
||||
* Passing NULL means the reason is not stored anywhere.
|
||||
* \return Whether the certificate is valid
|
||||
* @return Whether the certificate is valid
|
||||
*/
|
||||
- (bool)checkCertificateAndGetReason:
|
||||
(OFString *__autoreleasing _Nonnull *_Nullable)reason;
|
||||
|
||||
/**
|
||||
* \brief Adds the connection to the run loop.
|
||||
/*!
|
||||
* @brief Adds the connection to the run loop.
|
||||
*/
|
||||
- (void)handleConnection;
|
||||
|
||||
/**
|
||||
* \brief Asynchronously connects to the server and adds the connection to the
|
||||
/*!
|
||||
* @brief Asynchronously connects to the server and adds the connection to the
|
||||
* run loop.
|
||||
*/
|
||||
- (void)asyncConnectAndHandle;
|
||||
|
||||
/**
|
||||
* \brief Parses the specified buffer.
|
||||
/*!
|
||||
* @brief Parses the specified buffer.
|
||||
*
|
||||
* This is useful for handling multiple connections at once.
|
||||
*
|
||||
* \param buffer The buffer to parse
|
||||
* \param length The length of the buffer. If length is 0, it is assumed that
|
||||
* @param buffer The buffer to parse
|
||||
* @param length The length of the buffer. If length is 0, it is assumed that
|
||||
* the connection was closed.
|
||||
*/
|
||||
- (void)parseBuffer: (const void *)buffer
|
||||
length: (size_t)length;
|
||||
|
||||
/**
|
||||
* \brief Sends an OFXMLElement, usually an XMPPStanza.
|
||||
/*!
|
||||
* @brief Sends an OFXMLElement, usually an XMPPStanza.
|
||||
*
|
||||
* \param element The element to send
|
||||
* @param element The element to send
|
||||
*/
|
||||
- (void)sendStanza: (OFXMLElement *)element;
|
||||
|
||||
|
@ -302,10 +347,10 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
callbackBlock: (xmpp_callback_block_t)block;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Generates a new, unique stanza ID.
|
||||
/*!
|
||||
* @brief Generates a new, unique stanza ID.
|
||||
*
|
||||
* \return A new, generated, unique stanza ID.
|
||||
* @return A new, generated, unique stanza ID.
|
||||
*/
|
||||
- (OFString *)generateStanzaID;
|
||||
@end
|
||||
|
|
|
@ -31,8 +31,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class XMPPMessage;
|
||||
@class XMPPPresence;
|
||||
|
||||
/**
|
||||
* \brief A class describing a contact tracked by a XMPPContactManager
|
||||
/*!
|
||||
* @brief A class describing a contact tracked by a XMPPContactManager
|
||||
*/
|
||||
@interface XMPPContact: OFObject
|
||||
{
|
||||
|
@ -41,16 +41,21 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
XMPPJID *_lockedOnJID;
|
||||
}
|
||||
|
||||
/// \brief The XMPPRosterItem corresponding to this contact
|
||||
/*!
|
||||
* The XMPPRosterItem corresponding to this contact.
|
||||
*/
|
||||
@property (readonly, nonatomic) XMPPRosterItem *rosterItem;
|
||||
/// \brief The XMPPPresences of this contact with the resources as keys
|
||||
|
||||
/*!
|
||||
* The XMPPPresences of this contact with the resources as keys.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFDictionary *presences;
|
||||
|
||||
/**
|
||||
* \brief Sends a message to the contact honoring resource locking
|
||||
/*!
|
||||
* @brief Sends a message to the contact honoring resource locking
|
||||
*
|
||||
* \param message The message to send
|
||||
* \param connection The connection to use for sending the message
|
||||
* @param message The message to send
|
||||
* @param connection The connection to use for sending the message
|
||||
*/
|
||||
- (void)sendMessage: (XMPPMessage *)message
|
||||
connection: (XMPPConnection *)connection;
|
||||
|
|
|
@ -33,71 +33,71 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class XMPPMulticastDelegate;
|
||||
@class XMPPPresence;
|
||||
|
||||
/**
|
||||
* \brief A protocol that should be (partially) implemented by delegates
|
||||
/*!
|
||||
* @brief A protocol that should be (partially) implemented by delegates
|
||||
* of a XMPPContactManager
|
||||
*/
|
||||
@protocol XMPPContactManagerDelegate <OFObject>
|
||||
@optional
|
||||
/**
|
||||
* \brief This callback is called whenever a new contact enters the users roster
|
||||
/*!
|
||||
* @brief This callback is called whenever a new contact enters the users roster
|
||||
*
|
||||
* \param manager The contact manager that added the contact
|
||||
* \param contact The contact that was added
|
||||
* @param manager The contact manager that added the contact
|
||||
* @param contact The contact that was added
|
||||
*/
|
||||
- (void)contactManager: (XMPPContactManager *)manager
|
||||
didAddContact: (XMPPContact *)contact;
|
||||
|
||||
/**
|
||||
* \brief This callback is called whenever a contact is no longer present in
|
||||
/*!
|
||||
* @brief This callback is called whenever a contact is no longer present in
|
||||
* the users roster
|
||||
*
|
||||
* \param manager The contact manager that removed the contact
|
||||
* \param contact The contact that was removed
|
||||
* @param manager The contact manager that removed the contact
|
||||
* @param contact The contact that was removed
|
||||
*/
|
||||
- (void)contactManager: (XMPPContactManager *)manager
|
||||
didRemoveContact: (XMPPContact *)contact;
|
||||
|
||||
/**
|
||||
* \brief This callback is called when a subscription request is received
|
||||
/*!
|
||||
* @brief This callback is called when a subscription request is received
|
||||
*
|
||||
* \param manager The contact manager that received the request
|
||||
* \param presence The type=subscribe presence
|
||||
* @param manager The contact manager that received the request
|
||||
* @param presence The type=subscribe presence
|
||||
*/
|
||||
- (void)contactManager: (XMPPContactManager *)manager
|
||||
didReceiveSubscriptionRequest: (XMPPPresence *)presence;
|
||||
|
||||
/**
|
||||
* \brief This callback is called whenever a contact is about to change its
|
||||
/*!
|
||||
* @brief This callback is called whenever a contact is about to change its
|
||||
* roster item
|
||||
*
|
||||
* \param contact The contact about to updated its roster item
|
||||
* \param rosterItem The roster item the contact is going to update with
|
||||
* @param contact The contact about to updated its roster item
|
||||
* @param rosterItem The roster item the contact is going to update with
|
||||
*/
|
||||
- (void)contact: (XMPPContact *)contact
|
||||
willUpdateWithRosterItem: (XMPPRosterItem *)rosterItem;
|
||||
|
||||
/**
|
||||
* \brief This callback is called whenever a contact send a presence stanza
|
||||
/*!
|
||||
* @brief This callback is called whenever a contact send a presence stanza
|
||||
*
|
||||
* \param contact The contact that send the presence
|
||||
* \param presence The presence which was send by the contact
|
||||
* @param contact The contact that send the presence
|
||||
* @param presence The presence which was send by the contact
|
||||
*/
|
||||
- (void)contact: (XMPPContact *)contact
|
||||
didSendPresence: (XMPPPresence *)presence;
|
||||
|
||||
/**
|
||||
* \brief This callback is called whenever a contact send a message stanza
|
||||
/*!
|
||||
* @brief This callback is called whenever a contact send a message stanza
|
||||
*
|
||||
* \param contact The contact that send the message
|
||||
* \param message The message which was send by the contact
|
||||
* @param contact The contact that send the message
|
||||
* @param message The message which was send by the contact
|
||||
*/
|
||||
- (void)contact: (XMPPContact *)contact
|
||||
didSendMessage: (XMPPMessage *)message;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief A class tracking a XMPPContact instance for each contact in the roster
|
||||
/*!
|
||||
* @brief A class tracking a XMPPContact instance for each contact in the roster
|
||||
*
|
||||
* This class delegates to a XMPPConnection and a XMPPRoster, thereby tracking
|
||||
* each contacts presences and the current XMPPRosterItem.
|
||||
|
@ -111,7 +111,9 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
XMPPMulticastDelegate *_delegates;
|
||||
}
|
||||
|
||||
/// \brief The tracked contacts, with their bare JID as key
|
||||
/*!
|
||||
* The tracked contacts, with their bare JID as key.
|
||||
*/
|
||||
@property (readonly, nonatomic)
|
||||
OFDictionary OF_GENERIC(OFString *, XMPPContact *) *contacts;
|
||||
|
||||
|
@ -128,17 +130,17 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
- (void)sendSubscribedToJID: (XMPPJID *)subscriber;
|
||||
- (void)sendUnsubscribedToJID: (XMPPJID *)subscriber;
|
||||
|
||||
/**
|
||||
* \brief Adds the specified delegate.
|
||||
/*!
|
||||
* @brief Adds the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to add
|
||||
* @param delegate The delegate to add
|
||||
*/
|
||||
- (void)addDelegate: (id <XMPPContactManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* \brief Removes the specified delegate.
|
||||
/*!
|
||||
* @brief Removes the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to remove
|
||||
* @param delegate The delegate to remove
|
||||
*/
|
||||
- (void)removeDelegate: (id <XMPPContactManagerDelegate>)delegate;
|
||||
@end
|
||||
|
|
|
@ -30,8 +30,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@class XMPPJID;
|
||||
|
||||
/**
|
||||
* \brief A class representing an entity responding to Service Discovery
|
||||
/*!
|
||||
* @brief A class representing an entity responding to Service Discovery
|
||||
* queries
|
||||
*/
|
||||
@interface XMPPDiscoEntity: XMPPDiscoNode <XMPPConnectionDelegate>
|
||||
|
@ -41,8 +41,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFString *_capsNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief The XMPPDiscoNodes this entity provides Services Discovery
|
||||
/*!
|
||||
* @brief The XMPPDiscoNodes this entity provides Services Discovery
|
||||
* responses for
|
||||
*
|
||||
* This usually contains at least all immediate child nodes, but may contain
|
||||
|
@ -50,7 +50,7 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
*/
|
||||
@property (readonly) OFDictionary *discoNodes;
|
||||
|
||||
/**
|
||||
/*!
|
||||
* The node advertised for the entity's capabilites.
|
||||
*/
|
||||
@property (readonly) OFString *capsNode;
|
||||
|
@ -61,22 +61,22 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
node: (nullable OFString *)node
|
||||
name: (nullable OFString *)name OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoEntity with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoEntity with the specified
|
||||
* connection.
|
||||
*
|
||||
* \param connection The XMPPConnection to serve responses on.
|
||||
* \return A new autoreleased XMPPDiscoEntity
|
||||
* @param connection The XMPPConnection to serve responses on.
|
||||
* @return A new autoreleased XMPPDiscoEntity
|
||||
*/
|
||||
+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoEntity with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoEntity with the specified
|
||||
* connection.
|
||||
*
|
||||
* \param connection The XMPPConnection to serve responses on.
|
||||
* \param capsNode The node advertised for the entity's capabilites
|
||||
* \return A new autoreleased XMPPDiscoEntity
|
||||
* @param connection The XMPPConnection to serve responses on.
|
||||
* @param capsNode The node advertised for the entity's capabilites
|
||||
* @return A new autoreleased XMPPDiscoEntity
|
||||
*/
|
||||
+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection
|
||||
capsNode: (OFString *)capsNode;
|
||||
|
@ -87,39 +87,39 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
node: (nullable OFString *)node
|
||||
name: (nullable OFString *)name OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoEntity with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoEntity with the specified
|
||||
* connection.
|
||||
*
|
||||
* \param connection The XMPPConnection to serve responses on.
|
||||
* @param connection The XMPPConnection to serve responses on.
|
||||
* This must already be bound to a resource)
|
||||
* \return An initialized XMPPDiscoEntity
|
||||
* @return An initialized XMPPDiscoEntity
|
||||
*/
|
||||
- initWithConnection: (XMPPConnection *)connection;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoEntity with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoEntity with the specified
|
||||
* connection.
|
||||
*
|
||||
* \param connection The XMPPConnection to serve responses on.
|
||||
* @param connection The XMPPConnection to serve responses on.
|
||||
* This must already be bound to a resource)
|
||||
* \param capsNode The node advertised for the entity's capabilites
|
||||
* \return An initialized XMPPDiscoEntity
|
||||
* @param capsNode The node advertised for the entity's capabilites
|
||||
* @return An initialized XMPPDiscoEntity
|
||||
*/
|
||||
- initWithConnection: (XMPPConnection *)connection
|
||||
capsNode: (nullable OFString *)capsNode OF_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* \brief Adds a XMPPDiscoNode to provide responses for.
|
||||
/*!
|
||||
* @brief Adds a XMPPDiscoNode to provide responses for.
|
||||
*
|
||||
* \param node The XMPPDiscoNode to provide responses for
|
||||
* @param node The XMPPDiscoNode to provide responses for
|
||||
*/
|
||||
- (void)addDiscoNode: (XMPPDiscoNode *)node;
|
||||
|
||||
/**
|
||||
* \brief Calculates the Entity Capabilities Hash of the entity
|
||||
/*!
|
||||
* @brief Calculates the Entity Capabilities Hash of the entity
|
||||
*
|
||||
* \return A OFString containing the capabilities hash
|
||||
* @return A OFString containing the capabilities hash
|
||||
*/
|
||||
- (OFString *)capsHash;
|
||||
@end
|
||||
|
|
|
@ -25,67 +25,75 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class describing a Service Discovery Identity
|
||||
/*!
|
||||
* @brief A class describing a Service Discovery Identity
|
||||
*/
|
||||
@interface XMPPDiscoIdentity: OFObject <OFComparing>
|
||||
{
|
||||
OFString *_category, *_name, *_type;
|
||||
}
|
||||
|
||||
/// \brief The category of the identity
|
||||
/*!
|
||||
* The category of the identity.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *category;
|
||||
/// \brief The name of the identity, might be unset
|
||||
|
||||
/*!
|
||||
* The name of the identity, might be unset.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *name;
|
||||
/// \brief The type of the identity
|
||||
|
||||
/*!
|
||||
* The type of the identity.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *type;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoIdentity with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoIdentity with the specified
|
||||
* category, type and name.
|
||||
*
|
||||
* \param category The category of the identity
|
||||
* \param type The type of the identity
|
||||
* \param name The name of the identity
|
||||
* \return A new autoreleased XMPPDiscoIdentity
|
||||
* @param category The category of the identity
|
||||
* @param type The type of the identity
|
||||
* @param name The name of the identity
|
||||
* @return A new autoreleased XMPPDiscoIdentity
|
||||
*/
|
||||
+ (instancetype)identityWithCategory: (OFString *)category
|
||||
type: (OFString *)type
|
||||
name: (nullable OFString *)name;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoIdentity with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoIdentity with the specified
|
||||
* category and type.
|
||||
*
|
||||
* \param category The category of the identity
|
||||
* \param type The type of the identity
|
||||
* \return A new autoreleased XMPPDiscoIdentity
|
||||
* @param category The category of the identity
|
||||
* @param type The type of the identity
|
||||
* @return A new autoreleased XMPPDiscoIdentity
|
||||
*/
|
||||
+ (instancetype)identityWithCategory: (OFString *)category
|
||||
type: (OFString *)type;
|
||||
|
||||
- init OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoIdentity with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoIdentity with the specified
|
||||
* category, type and name.
|
||||
*
|
||||
* \param category The category of the identity
|
||||
* \param type The type of the identity
|
||||
* \param name The name of the identity
|
||||
* \return An initialized XMPPDiscoIdentity
|
||||
* @param category The category of the identity
|
||||
* @param type The type of the identity
|
||||
* @param name The name of the identity
|
||||
* @return An initialized XMPPDiscoIdentity
|
||||
*/
|
||||
- initWithCategory: (OFString *)category
|
||||
type: (OFString *)type
|
||||
name: (nullable OFString *)name OF_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoIdentity with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoIdentity with the specified
|
||||
* category and type.
|
||||
*
|
||||
* \param category The category of the identity
|
||||
* \param type The type of the identity
|
||||
* \return An initialized XMPPDiscoIdentity
|
||||
* @param category The category of the identity
|
||||
* @param type The type of the identity
|
||||
* @return An initialized XMPPDiscoIdentity
|
||||
*/
|
||||
- initWithCategory: (OFString *)category
|
||||
type: (OFString *)type;
|
||||
|
|
|
@ -28,8 +28,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class XMPPDiscoIdentity;
|
||||
@class XMPPJID;
|
||||
|
||||
/**
|
||||
* \brief A class describing a Service Discovery Node
|
||||
/*!
|
||||
* @brief A class describing a Service Discovery Node
|
||||
*/
|
||||
@interface XMPPDiscoNode: OFObject
|
||||
{
|
||||
|
@ -41,85 +41,102 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFMutableDictionary *_childNodes;
|
||||
}
|
||||
|
||||
/// \brief The JID this node lives on
|
||||
/*!
|
||||
* @brief The JID this node lives on.
|
||||
*/
|
||||
@property (readonly, nonatomic) XMPPJID *JID;
|
||||
/// \brief The node's opaque name of the node
|
||||
|
||||
/*!
|
||||
* @brief The node's opaque name of the node.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *node;
|
||||
/// \brief The node's human friendly name (may be unspecified)
|
||||
|
||||
/*!
|
||||
* @brief The node's human friendly name (may be unspecified).
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *name;
|
||||
/// \brief The node's list of identities
|
||||
|
||||
/*!
|
||||
* @brief The node's list of identities.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFSortedList *identities;
|
||||
/// \brief The node's list of features
|
||||
|
||||
/*!
|
||||
* @brief The node's list of features.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFSortedList *features;
|
||||
/// \brief The node's children
|
||||
|
||||
/*!
|
||||
* @brief The node's children.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFDictionary *childNodes;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoNode with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoNode with the specified
|
||||
* JID and node
|
||||
*
|
||||
* \param JID The JID this node lives on
|
||||
* \param node The node's opaque name
|
||||
* \return A new autoreleased XMPPDiscoNode
|
||||
* @param JID The JID this node lives on
|
||||
* @param node The node's opaque name
|
||||
* @return A new autoreleased XMPPDiscoNode
|
||||
*/
|
||||
+ (instancetype)discoNodeWithJID: (XMPPJID *)JID
|
||||
node: (nullable OFString *)node;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPDiscoNode with the specified
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPDiscoNode with the specified
|
||||
* JID, node and name
|
||||
*
|
||||
* \param JID The JID this node lives on
|
||||
* \param node The node's opaque name
|
||||
* \param name The node's human friendly name
|
||||
* \return A new autoreleased XMPPDiscoNode
|
||||
* @param JID The JID this node lives on
|
||||
* @param node The node's opaque name
|
||||
* @param name The node's human friendly name
|
||||
* @return A new autoreleased XMPPDiscoNode
|
||||
*/
|
||||
+ (instancetype)discoNodeWithJID: (XMPPJID *)JID
|
||||
node: (nullable OFString *)node
|
||||
name: (nullable OFString *)name;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoNode with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoNode with the specified
|
||||
* JID and node
|
||||
*
|
||||
* \param JID The JID this node lives on
|
||||
* \param node The node's opaque name
|
||||
* \return An initialized XMPPDiscoNode
|
||||
* @param JID The JID this node lives on
|
||||
* @param node The node's opaque name
|
||||
* @return An initialized XMPPDiscoNode
|
||||
*/
|
||||
- initWithJID: (XMPPJID *)JID
|
||||
node: (nullable OFString *)node;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPDiscoNode with the specified
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPDiscoNode with the specified
|
||||
* JID, node and name
|
||||
*
|
||||
* \param JID The JID this node lives on
|
||||
* \param node The node's opaque name
|
||||
* \param name The node's human friendly name
|
||||
* \return An initialized XMPPDiscoNode
|
||||
* @param JID The JID this node lives on
|
||||
* @param node The node's opaque name
|
||||
* @param name The node's human friendly name
|
||||
* @return An initialized XMPPDiscoNode
|
||||
*/
|
||||
- initWithJID: (XMPPJID *)JID
|
||||
node: (nullable OFString *)node
|
||||
name: (nullable OFString *)name OF_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* \brief Adds an XMPPDiscoIdentity to the node
|
||||
/*!
|
||||
* @brief Adds an XMPPDiscoIdentity to the node
|
||||
*
|
||||
* \param identity The XMPPDiscoIdentity to add
|
||||
* @param identity The XMPPDiscoIdentity to add
|
||||
*/
|
||||
- (void)addIdentity: (XMPPDiscoIdentity *)identity;
|
||||
|
||||
/**
|
||||
* \brief Adds a feature to the node
|
||||
/*!
|
||||
* @brief Adds a feature to the node
|
||||
*
|
||||
* \param feature The feature to add
|
||||
* @param feature The feature to add
|
||||
*/
|
||||
- (void)addFeature: (OFString *)feature;
|
||||
|
||||
/**
|
||||
* \brief Adds a XMPPDiscoNode as child of the node
|
||||
/*!
|
||||
* @brief Adds a XMPPDiscoNode as child of the node
|
||||
*
|
||||
* \param node The XMPPDiscoNode to add as child
|
||||
* @param node The XMPPDiscoNode to add as child
|
||||
*/
|
||||
- (void)addChildNode: (XMPPDiscoNode *)node;
|
||||
@end
|
||||
|
|
|
@ -25,22 +25,22 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class to authenticate using SASL EXTERNAL
|
||||
/*!
|
||||
* @brief A class to authenticate using SASL EXTERNAL
|
||||
*/
|
||||
@interface XMPPEXTERNALAuth: XMPPAuthenticator
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPEXTERNALAuth.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPEXTERNALAuth.
|
||||
*
|
||||
* \return A new autoreleased XMPPEXTERNALAuth
|
||||
* @return A new autoreleased XMPPEXTERNALAuth
|
||||
*/
|
||||
+ (instancetype)EXTERNALAuth;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPEXTERNALAuth with an authzid.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPEXTERNALAuth with an authzid.
|
||||
*
|
||||
* \param authzid The authzid to get authorization for
|
||||
* \return A new autoreleased XMPPEXTERNALAuth
|
||||
* @param authzid The authzid to get authorization for
|
||||
* @return A new autoreleased XMPPEXTERNALAuth
|
||||
*/
|
||||
+ (instancetype)EXTERNALAuthWithAuthzid: (nullable OFString *)authzid;
|
||||
@end
|
||||
|
|
|
@ -28,59 +28,66 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class XMPPConnection;
|
||||
@class XMPPAuthenticator;
|
||||
|
||||
/**
|
||||
* \brief A base class for XMPP related exceptions
|
||||
/*!
|
||||
* @brief A base class for XMPP related exceptions
|
||||
*/
|
||||
@interface XMPPException: OFException
|
||||
{
|
||||
XMPPConnection *_connection;
|
||||
}
|
||||
|
||||
/// \brief The connection the exception relates to
|
||||
/*!
|
||||
* The connection the exception relates to.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) XMPPConnection *connection;
|
||||
|
||||
/**
|
||||
* \brief Creates a new XMPPException.
|
||||
/*!
|
||||
* @brief Creates a new XMPPException.
|
||||
*
|
||||
* \param connection The connection that received the data responsible
|
||||
* @param connection The connection that received the data responsible
|
||||
* for this exception
|
||||
* \return A new XMPPException
|
||||
* @return A new XMPPException
|
||||
*/
|
||||
+ (instancetype)exceptionWithConnection: (nullable XMPPConnection *)connection;
|
||||
|
||||
- init OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPException.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPException.
|
||||
*
|
||||
* \param connection The connection that received the data responsible
|
||||
* @param connection The connection that received the data responsible
|
||||
* for this exception
|
||||
* \return An initialized XMPPException
|
||||
* @return An initialized XMPPException
|
||||
*/
|
||||
- initWithConnection: (nullable XMPPConnection *)connection
|
||||
OF_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief An exception indicating a stream error was received
|
||||
/*!
|
||||
* @brief An exception indicating a stream error was received
|
||||
*/
|
||||
@interface XMPPStreamErrorException: XMPPException
|
||||
{
|
||||
OFString *_condition, *_reason;
|
||||
}
|
||||
|
||||
/// \brief The defined error condition specified by the stream error
|
||||
/*!
|
||||
* @brief The defined error condition specified by the stream error.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *condition;
|
||||
/// \brief The descriptive free-form text specified by the stream error
|
||||
|
||||
/*!
|
||||
* @brief The descriptive free-form text specified by the stream error.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *reason;
|
||||
|
||||
/**
|
||||
* \brief Creates a new XMPPStreamErrorException.
|
||||
/*!
|
||||
* @brief Creates a new XMPPStreamErrorException.
|
||||
*
|
||||
* \param connection The connection that received the stream error
|
||||
* \param condition The defined error condition specified by the stream error
|
||||
* \param reason The descriptive free-form text specified by the stream error
|
||||
* \return A new XMPPStreamErrorException
|
||||
* @param connection The connection that received the stream error
|
||||
* @param condition The defined error condition specified by the stream error
|
||||
* @param reason The descriptive free-form text specified by the stream error
|
||||
* @return A new XMPPStreamErrorException
|
||||
*/
|
||||
+ (instancetype)exceptionWithConnection: (nullable XMPPConnection *)connection
|
||||
condition: (OFString *)condition
|
||||
|
@ -88,21 +95,21 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- initWithConnection: (nullable XMPPConnection *)connection OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStreamErrorException.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStreamErrorException.
|
||||
*
|
||||
* \param connection The connection that received the stream error
|
||||
* \param condition The defined error condition specified by the stream error
|
||||
* \param reason The descriptive free-form text specified by the stream error
|
||||
* \return An initialized XMPPStreamErrorException
|
||||
* @param connection The connection that received the stream error
|
||||
* @param condition The defined error condition specified by the stream error
|
||||
* @param reason The descriptive free-form text specified by the stream error
|
||||
* @return An initialized XMPPStreamErrorException
|
||||
*/
|
||||
- initWithConnection: (nullable XMPPConnection *)connection
|
||||
condition: (OFString *)condition
|
||||
reason: (OFString *)reason OF_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief An exception indicating a stringprep profile
|
||||
/*!
|
||||
* @brief An exception indicating a stringprep profile
|
||||
* did not apply to a string
|
||||
*/
|
||||
@interface XMPPStringPrepFailedException: XMPPException
|
||||
|
@ -110,18 +117,23 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFString *_profile, *_string;
|
||||
}
|
||||
|
||||
/// \brief The name of the stringprep profile that did not apply
|
||||
/*!
|
||||
* @brief The name of the stringprep profile that did not apply.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *profile;
|
||||
/// \brief The string that failed the stringprep profile
|
||||
|
||||
/*!
|
||||
* @brief The string that failed the stringprep profile.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *string;
|
||||
|
||||
/**
|
||||
* \brief Creates a new XMPPStringPrepFailedException.
|
||||
/*!
|
||||
* @brief Creates a new XMPPStringPrepFailedException.
|
||||
*
|
||||
* \param connection The connection the string relates to
|
||||
* \param profile The name of the stringprep profile that did not apply
|
||||
* \param string The string that failed the stringprep profile
|
||||
* \return A new XMPPStringPrepFailedException
|
||||
* @param connection The connection the string relates to
|
||||
* @param profile The name of the stringprep profile that did not apply
|
||||
* @param string The string that failed the stringprep profile
|
||||
* @return A new XMPPStringPrepFailedException
|
||||
*/
|
||||
+ (instancetype)exceptionWithConnection: (nullable XMPPConnection *)connection
|
||||
profile: (OFString *)profile
|
||||
|
@ -129,39 +141,44 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- initWithConnection: (nullable XMPPConnection *)connection OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStringPrepFailedException.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStringPrepFailedException.
|
||||
*
|
||||
* \param connection The connection the string relates to
|
||||
* \param profile The name of the stringprep profile that did not apply
|
||||
* \param string The string that failed the stringprep profile
|
||||
* \return An initialized XMPPStringPrepFailedException
|
||||
* @param connection The connection the string relates to
|
||||
* @param profile The name of the stringprep profile that did not apply
|
||||
* @param string The string that failed the stringprep profile
|
||||
* @return An initialized XMPPStringPrepFailedException
|
||||
*/
|
||||
- initWithConnection: (nullable XMPPConnection *)connection
|
||||
profile: (OFString *)profile
|
||||
string: (OFString *)string OF_DESIGNATED_INITIALIZER;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief An exception indicating IDNA translation of a string failed
|
||||
/*!
|
||||
* @brief An exception indicating IDNA translation of a string failed
|
||||
*/
|
||||
@interface XMPPIDNATranslationFailedException: XMPPException
|
||||
{
|
||||
OFString *_operation, *_string;
|
||||
}
|
||||
|
||||
/// \brief The IDNA translation operation which failed
|
||||
/*!
|
||||
* @brief The IDNA translation operation which failed.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *operation;
|
||||
/// \brief The string that could not be translated
|
||||
|
||||
/*!
|
||||
* @brief The string that could not be translated.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *string;
|
||||
|
||||
/**
|
||||
* \brief Creates a new XMPPIDNATranslationFailedException.
|
||||
/*!
|
||||
* @brief Creates a new XMPPIDNATranslationFailedException.
|
||||
*
|
||||
* \param connection The connection the string relates to
|
||||
* \param operation The name of the stringprep profile that did not apply
|
||||
* \param string The string that could not be translated
|
||||
* \return A new XMPPIDNATranslationFailedException
|
||||
* @param connection The connection the string relates to
|
||||
* @param operation The name of the stringprep profile that did not apply
|
||||
* @param string The string that could not be translated
|
||||
* @return A new XMPPIDNATranslationFailedException
|
||||
*/
|
||||
+ (instancetype)exceptionWithConnection: (nullable XMPPConnection *)connection
|
||||
operation: (OFString *)operation
|
||||
|
@ -169,48 +186,50 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- initWithConnection: (nullable XMPPConnection *)connection OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPIDNATranslationFailedException.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPIDNATranslationFailedException.
|
||||
*
|
||||
* \param connection The connection the string relates to
|
||||
* \param operation The name of the stringprep profile that did not apply
|
||||
* \param string The string that could not be translated
|
||||
* \return An initialized XMPPIDNATranslationFailedException
|
||||
* @param connection The connection the string relates to
|
||||
* @param operation The name of the stringprep profile that did not apply
|
||||
* @param string The string that could not be translated
|
||||
* @return An initialized XMPPIDNATranslationFailedException
|
||||
*/
|
||||
- initWithConnection: (nullable XMPPConnection *)connection
|
||||
operation: (OFString *)operation
|
||||
string: (OFString *)string;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief An exception indicating authentication failed
|
||||
/*!
|
||||
* @brief An exception indicating authentication failed
|
||||
*/
|
||||
@interface XMPPAuthFailedException: XMPPException
|
||||
{
|
||||
OFString *_reason;
|
||||
}
|
||||
|
||||
/// \brief The reason the authentication failed
|
||||
/*!
|
||||
* The reason the authentication failed.
|
||||
*/
|
||||
@property (readonly, nonatomic) OFString *reason;
|
||||
|
||||
/**
|
||||
* \brief Creates a new XMPPAuthFailedException.
|
||||
/*!
|
||||
* @brief Creates a new XMPPAuthFailedException.
|
||||
*
|
||||
* \param connection The connection that could not be authenticated
|
||||
* \param reason The reason the authentication failed
|
||||
* \return A new XMPPAuthFailedException
|
||||
* @param connection The connection that could not be authenticated
|
||||
* @param reason The reason the authentication failed
|
||||
* @return A new XMPPAuthFailedException
|
||||
*/
|
||||
+ (instancetype)exceptionWithConnection: (nullable XMPPConnection *)connection
|
||||
reason: (OFString *)reason;
|
||||
|
||||
- initWithConnection: (nullable XMPPConnection *)connection OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPAuthFailedException.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPAuthFailedException.
|
||||
*
|
||||
* \param connection The connection that could not be authenticated
|
||||
* \param reason The reason the authentication failed
|
||||
* \return An initialized XMPPAuthFailedException
|
||||
* @param connection The connection that could not be authenticated
|
||||
* @param reason The reason the authentication failed
|
||||
* @return An initialized XMPPAuthFailedException
|
||||
*/
|
||||
- initWithConnection: (nullable XMPPConnection *)connection
|
||||
reason: (OFString *)reason OF_DESIGNATED_INITIALIZER;
|
||||
|
|
52
src/XMPPIQ.h
52
src/XMPPIQ.h
|
@ -25,56 +25,56 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class describing an IQ stanza.
|
||||
/*!
|
||||
* @brief A class describing an IQ stanza.
|
||||
*/
|
||||
@interface XMPPIQ: XMPPStanza
|
||||
/**
|
||||
* \brief Creates a new XMPPIQ with the specified type and ID.
|
||||
/*!
|
||||
* @brief Creates a new XMPPIQ with the specified type and ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPIQ
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPIQ
|
||||
*/
|
||||
+ (instancetype)IQWithType: (OFString *)type
|
||||
ID: (OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPIQ with the specified type and
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPIQ with the specified type and
|
||||
* ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return An initialized XMPPIQ
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return An initialized XMPPIQ
|
||||
*/
|
||||
- initWithType: (OFString *)type
|
||||
ID: (OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Generates a result IQ for the receiving object.
|
||||
/*!
|
||||
* @brief Generates a result IQ for the receiving object.
|
||||
*
|
||||
* \return A new autoreleased XMPPIQ
|
||||
* @return A new autoreleased XMPPIQ
|
||||
*/
|
||||
- (XMPPIQ *)resultIQ;
|
||||
|
||||
/**
|
||||
* \brief Generates an error IQ for the receiving object.
|
||||
/*!
|
||||
* @brief Generates an error IQ for the receiving object.
|
||||
*
|
||||
* \param type An error type as defined by RFC 6120
|
||||
* \param condition An error condition as defined by RFC 6120
|
||||
* \param text A descriptive text
|
||||
* \return A new autoreleased XMPPIQ
|
||||
* @param type An error type as defined by RFC 6120
|
||||
* @param condition An error condition as defined by RFC 6120
|
||||
* @param text A descriptive text
|
||||
* @return A new autoreleased XMPPIQ
|
||||
*/
|
||||
- (XMPPIQ *)errorIQWithType: (OFString *)type
|
||||
condition: (OFString *)condition
|
||||
text: (nullable OFString *)text;
|
||||
|
||||
/**
|
||||
* \brief Generates an error IQ for the receiving object.
|
||||
/*!
|
||||
* @brief Generates an error IQ for the receiving object.
|
||||
*
|
||||
* \param type An error type as defined by RFC 6120
|
||||
* \param condition A defined conditions from RFC 6120
|
||||
* \return A new autoreleased XMPPIQ
|
||||
* @param type An error type as defined by RFC 6120
|
||||
* @param condition A defined conditions from RFC 6120
|
||||
* @return A new autoreleased XMPPIQ
|
||||
*/
|
||||
- (XMPPIQ *)errorIQWithType: (OFString *)type
|
||||
condition: (OFString *)condition;
|
||||
|
|
|
@ -25,55 +25,63 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class for easy handling of JIDs.
|
||||
/*!
|
||||
* @brief A class for easy handling of JIDs.
|
||||
*/
|
||||
@interface XMPPJID: OFObject <OFCopying>
|
||||
{
|
||||
OFString *_node, *_domain, *_resource;
|
||||
}
|
||||
|
||||
/// \brief The JID's localpart
|
||||
/*!
|
||||
* The JID's localpart.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *node;
|
||||
/// \brief The JID's domainpart
|
||||
|
||||
/*!
|
||||
* The JID's domainpart.
|
||||
*/
|
||||
@property (nonatomic, copy) OFString *domain;
|
||||
/// \brief The JID's resourcepart
|
||||
|
||||
/*!
|
||||
* The JID's resourcepart.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *resource;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPJID.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPJID.
|
||||
*
|
||||
* \return A new autoreleased XMPPJID
|
||||
* @return A new autoreleased XMPPJID
|
||||
*/
|
||||
+ (instancetype)JID;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPJID from a string.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPJID from a string.
|
||||
*
|
||||
* \param string The string to parse into a JID object
|
||||
* \return A new autoreleased XMPPJID
|
||||
* @param string The string to parse into a JID object
|
||||
* @return A new autoreleased XMPPJID
|
||||
*/
|
||||
+ (instancetype)JIDWithString: (OFString *)string;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPJID with a string.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPJID with a string.
|
||||
*
|
||||
* \param string The string to parse into a JID object
|
||||
* \return A initialized XMPPJID
|
||||
* @param string The string to parse into a JID object
|
||||
* @return A initialized XMPPJID
|
||||
*/
|
||||
- initWithString: (OFString *)string;
|
||||
|
||||
/**
|
||||
* \brief Returns the bare JID.
|
||||
/*!
|
||||
* @brief Returns the bare JID.
|
||||
*
|
||||
* \return An OFString containing the bare JID
|
||||
* @return An OFString containing the bare JID
|
||||
*/
|
||||
- (OFString *)bareJID;
|
||||
|
||||
/**
|
||||
* \brief Returns the full JID.
|
||||
/*!
|
||||
* @brief Returns the full JID.
|
||||
*
|
||||
* \return An OFString containing the full JID
|
||||
* @return An OFString containing the full JID
|
||||
*/
|
||||
- (OFString *)fullJID;
|
||||
@end
|
||||
|
|
|
@ -25,69 +25,69 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class describing a message stanza.
|
||||
/*!
|
||||
* @brief A class describing a message stanza.
|
||||
*/
|
||||
@interface XMPPMessage: XMPPStanza
|
||||
/** The text content of the body of the message. */
|
||||
/*! The text content of the body of the message. */
|
||||
@property (copy) OFString *body;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPMessage.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPMessage.
|
||||
*
|
||||
* \return A new autoreleased XMPPMessage
|
||||
* @return A new autoreleased XMPPMessage
|
||||
*/
|
||||
+ (instancetype)message;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPMessage with the specified ID.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPMessage with the specified ID.
|
||||
*
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPMessage
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPMessage
|
||||
*/
|
||||
+ (instancetype)messageWithID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPMessage with the specified type.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPMessage with the specified type.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A new autoreleased XMPPMessage
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A new autoreleased XMPPMessage
|
||||
*/
|
||||
+ (instancetype)messageWithType: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPMessage with the specified type and ID.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPMessage with the specified type and ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPMessage
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPMessage
|
||||
*/
|
||||
+ (instancetype)messageWithType: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPMessage with the specified ID.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPMessage with the specified ID.
|
||||
*
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPMessage
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPMessage
|
||||
*/
|
||||
- initWithID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPMessage with the specified type.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPMessage with the specified type.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A initialized XMPPMessage
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A initialized XMPPMessage
|
||||
*/
|
||||
- initWithType: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPMessage with the specified type
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPMessage with the specified type
|
||||
* and ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPMessage
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPMessage
|
||||
*/
|
||||
- initWithType: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID OF_DESIGNATED_INITIALIZER;
|
||||
|
|
|
@ -26,43 +26,43 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@class OFMutableData;
|
||||
|
||||
/**
|
||||
* \brief A class to provide multiple delegates in a single class
|
||||
/*!
|
||||
* @brief A class to provide multiple delegates in a single class
|
||||
*/
|
||||
@interface XMPPMulticastDelegate: OFObject
|
||||
{
|
||||
OFMutableData *_delegates;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Adds a delegate which should receive the broadcasts.
|
||||
/*!
|
||||
* @brief Adds a delegate which should receive the broadcasts.
|
||||
*
|
||||
* \param delegate The delegate to add
|
||||
* @param delegate The delegate to add
|
||||
*/
|
||||
- (void)addDelegate: (id)delegate;
|
||||
|
||||
/**
|
||||
* \brief Removes a delegate so it does not receive the broadcasts anymore.
|
||||
/*!
|
||||
* @brief Removes a delegate so it does not receive the broadcasts anymore.
|
||||
*
|
||||
* \param delegate The delegate to remove
|
||||
* @param delegate The delegate to remove
|
||||
*/
|
||||
- (void)removeDelegate: (id)delegate;
|
||||
|
||||
/**
|
||||
* \brief Broadcasts a selector with an object to all registered delegates.
|
||||
/*!
|
||||
* @brief Broadcasts a selector with an object to all registered delegates.
|
||||
*
|
||||
* \param selector The selector to broadcast
|
||||
* \param object The object to broadcast
|
||||
* @param selector The selector to broadcast
|
||||
* @param object The object to broadcast
|
||||
*/
|
||||
- (bool)broadcastSelector: (SEL)selector
|
||||
withObject: (nullable id)object;
|
||||
|
||||
/**
|
||||
* \brief Broadcasts a selector with two objects to all registered delegates.
|
||||
/*!
|
||||
* @brief Broadcasts a selector with two objects to all registered delegates.
|
||||
*
|
||||
* \param selector The selector to broadcast
|
||||
* \param object1 The first object to broadcast
|
||||
* \param object2 The second object to broadcast
|
||||
* @param selector The selector to broadcast
|
||||
* @param object1 The first object to broadcast
|
||||
* @param object2 The second object to broadcast
|
||||
*/
|
||||
- (bool)broadcastSelector: (SEL)selector
|
||||
withObject: (nullable id)object1
|
||||
|
|
|
@ -25,28 +25,28 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class to authenticate using SASL PLAIN
|
||||
/*!
|
||||
* @brief A class to authenticate using SASL PLAIN
|
||||
*/
|
||||
@interface XMPPPLAINAuth: XMPPAuthenticator
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPLAINAuth with an authcid and password.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPLAINAuth with an authcid and password.
|
||||
*
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \return A new autoreleased XMPPPLAINAuth
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @return A new autoreleased XMPPPLAINAuth
|
||||
*/
|
||||
+ (instancetype)PLAINAuthWithAuthcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPLAINAuth with an authzid, authcid and
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPLAINAuth with an authzid, authcid and
|
||||
* password.
|
||||
*
|
||||
* \param authzid The authzid to get authorization for
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \return A new autoreleased XMPPPLAINAuth
|
||||
* @param authzid The authzid to get authorization for
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @return A new autoreleased XMPPPLAINAuth
|
||||
*/
|
||||
+ (instancetype)PLAINAuthWithAuthzid: (nullable OFString *)authzid
|
||||
authcid: (nullable OFString *)authcid
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class describing a presence stanza.
|
||||
/*!
|
||||
* @brief A class describing a presence stanza.
|
||||
*/
|
||||
@interface XMPPPresence: XMPPStanza <OFComparing>
|
||||
{
|
||||
|
@ -34,83 +34,83 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFNumber *_priority;
|
||||
}
|
||||
|
||||
/**
|
||||
/*!
|
||||
* The value of the stanza's type attribute.
|
||||
*/
|
||||
@property OF_NULL_RESETTABLE_PROPERTY (nonatomic, copy) OFString *type;
|
||||
|
||||
/**
|
||||
/*!
|
||||
* The text content of the status element.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *status;
|
||||
|
||||
/**
|
||||
/*!
|
||||
* The text content of the show element of the presence stanza.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *show;
|
||||
|
||||
/**
|
||||
/*!
|
||||
* The numeric content of the priority element.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFNumber *priority;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPresence.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPresence.
|
||||
*
|
||||
* \return A new autoreleased XMPPPresence
|
||||
* @return A new autoreleased XMPPPresence
|
||||
*/
|
||||
+ (instancetype)presence;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPresence with the specified ID.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPresence with the specified ID.
|
||||
*
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPPresence
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPPresence
|
||||
*/
|
||||
+ (instancetype)presenceWithID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPresence with the specified type.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPresence with the specified type.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A new autoreleased XMPPPresence
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A new autoreleased XMPPPresence
|
||||
*/
|
||||
+ (instancetype)presenceWithType: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPPresence with the specified type and
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPPresence with the specified type and
|
||||
* ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPPresence
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPPresence
|
||||
*/
|
||||
+ (instancetype)presenceWithType: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPPresence with the specified ID.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPPresence with the specified ID.
|
||||
*
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPPresence
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPPresence
|
||||
*/
|
||||
- initWithID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPPresence with the specified type.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPPresence with the specified type.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A initialized XMPPPresence
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A initialized XMPPPresence
|
||||
*/
|
||||
- initWithType: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPPresence with the specified type
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPPresence with the specified type
|
||||
* and ID.
|
||||
*
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPPresence
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPPresence
|
||||
*/
|
||||
- initWithType: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID;
|
||||
|
|
|
@ -33,32 +33,32 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
@class XMPPRoster;
|
||||
@class XMPPMulticastDelegate;
|
||||
|
||||
/**
|
||||
* \brief A protocol that should be (partially) implemented by delegates
|
||||
/*!
|
||||
* @brief A protocol that should be (partially) implemented by delegates
|
||||
* of a XMPPRoster
|
||||
*/
|
||||
@protocol XMPPRosterDelegate
|
||||
@optional
|
||||
/**
|
||||
* \brief This callback is called after the roster was received (as a result of
|
||||
/*!
|
||||
* @brief This callback is called after the roster was received (as a result of
|
||||
* calling -requestRoster).
|
||||
*
|
||||
* \param roster The roster that was received
|
||||
* @param roster The roster that was received
|
||||
*/
|
||||
- (void)rosterWasReceived: (XMPPRoster *)roster;
|
||||
|
||||
/**
|
||||
* \brief This callback is called whenever a roster push was received.
|
||||
/*!
|
||||
* @brief This callback is called whenever a roster push was received.
|
||||
*
|
||||
* \param roster The roster that was updated by the roster push
|
||||
* \param rosterItem The roster item received in the push
|
||||
* @param roster The roster that was updated by the roster push
|
||||
* @param rosterItem The roster item received in the push
|
||||
*/
|
||||
- (void)roster: (XMPPRoster *)roster
|
||||
didReceiveRosterItem: (XMPPRosterItem *)rosterItem;
|
||||
@end
|
||||
|
||||
/**
|
||||
* \brief A class implementing roster related functionality.
|
||||
/*!
|
||||
* @brief A class implementing roster related functionality.
|
||||
*/
|
||||
@interface XMPPRoster: OFObject <XMPPConnectionDelegate>
|
||||
{
|
||||
|
@ -69,20 +69,20 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
bool _rosterRequested;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief The connection to which the roster belongs
|
||||
/*!
|
||||
* @brief The connection to which the roster belongs
|
||||
*/
|
||||
@property (readonly, assign) XMPPConnection *connection;
|
||||
|
||||
/**
|
||||
* \brief An object for data storage, conforming to the XMPPStorage protocol.
|
||||
/*!
|
||||
* @brief An object for data storage, conforming to the XMPPStorage protocol.
|
||||
*
|
||||
* Inherited from the connection if not overridden.
|
||||
*/
|
||||
@property (nonatomic, assign) id <XMPPStorage> dataStorage;
|
||||
|
||||
/**
|
||||
* \brief The list of contacts as an OFDictionary with the bare JID as a string
|
||||
/*!
|
||||
* @brief The list of contacts as an OFDictionary with the bare JID as a string
|
||||
* as key.
|
||||
*/
|
||||
@property (readonly, nonatomic)
|
||||
|
@ -90,52 +90,52 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- init OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPRoster.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPRoster.
|
||||
*
|
||||
* \param connection The connection roster related stanzas are send and
|
||||
* @param connection The connection roster related stanzas are send and
|
||||
* received over
|
||||
* \return An initialized XMPPRoster
|
||||
* @return An initialized XMPPRoster
|
||||
*/
|
||||
- initWithConnection: (XMPPConnection *)connection OF_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* \brief Requests the roster from the server.
|
||||
/*!
|
||||
* @brief Requests the roster from the server.
|
||||
*/
|
||||
- (void)requestRoster;
|
||||
|
||||
/**
|
||||
* \brief Adds a new contact to the roster.
|
||||
/*!
|
||||
* @brief Adds a new contact to the roster.
|
||||
*
|
||||
* \param rosterItem The roster item to add to the roster
|
||||
* @param rosterItem The roster item to add to the roster
|
||||
*/
|
||||
- (void)addRosterItem: (XMPPRosterItem *)rosterItem;
|
||||
|
||||
/**
|
||||
* \brief Updates an already existing contact in the roster.
|
||||
/*!
|
||||
* @brief Updates an already existing contact in the roster.
|
||||
*
|
||||
* \param rosterItem The roster item to update
|
||||
* @param rosterItem The roster item to update
|
||||
*/
|
||||
- (void)updateRosterItem: (XMPPRosterItem *)rosterItem;
|
||||
|
||||
/**
|
||||
* \brief Delete a contact from the roster.
|
||||
/*!
|
||||
* @brief Delete a contact from the roster.
|
||||
*
|
||||
* \param rosterItem The roster item to delete
|
||||
* @param rosterItem The roster item to delete
|
||||
*/
|
||||
- (void)deleteRosterItem: (XMPPRosterItem *)rosterItem;
|
||||
|
||||
/**
|
||||
* \brief Adds the specified delegate.
|
||||
/*!
|
||||
* @brief Adds the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to add
|
||||
* @param delegate The delegate to add
|
||||
*/
|
||||
- (void)addDelegate: (id <XMPPRosterDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* \brief Removes the specified delegate.
|
||||
/*!
|
||||
* @brief Removes the specified delegate.
|
||||
*
|
||||
* \param delegate The delegate to remove
|
||||
* @param delegate The delegate to remove
|
||||
*/
|
||||
- (void)removeDelegate: (id <XMPPRosterDelegate>)delegate;
|
||||
@end
|
||||
|
|
|
@ -27,8 +27,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@class XMPPJID;
|
||||
|
||||
/**
|
||||
* \brief A class for representing an item in the roster.
|
||||
/*!
|
||||
* @brief A class for representing an item in the roster.
|
||||
*/
|
||||
@interface XMPPRosterItem: OFObject
|
||||
{
|
||||
|
@ -38,19 +38,30 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFArray *_groups;
|
||||
}
|
||||
|
||||
/// \brief The JID of the roster item
|
||||
/*!
|
||||
* The JID of the roster item.
|
||||
*/
|
||||
@property (nonatomic, copy) XMPPJID *JID;
|
||||
/// \brief The name of the roster item to show to the user
|
||||
|
||||
/*!
|
||||
* The name of the roster item to show to the user.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *name;
|
||||
/// \brief The subscription for the roster item
|
||||
|
||||
/*!
|
||||
* The subscription for the roster item.
|
||||
*/
|
||||
@property (nonatomic, copy) OFString *subscription;
|
||||
/// \brief An array of groups in which the roster item is
|
||||
|
||||
/*!
|
||||
* An array of groups in which the roster item is.
|
||||
*/
|
||||
@property (nonatomic, copy) OFArray OF_GENERIC(OFString *) *groups;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased roster item.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased roster item.
|
||||
*
|
||||
* \return A new autoreleased roster item.
|
||||
* @return A new autoreleased roster item.
|
||||
*/
|
||||
+ (instancetype)rosterItem;
|
||||
@end
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* \brief A class to authenticate using SCRAM
|
||||
/*!
|
||||
* @brief A class to authenticate using SCRAM
|
||||
*/
|
||||
@interface XMPPSCRAMAuth: XMPPAuthenticator
|
||||
{
|
||||
|
@ -41,15 +41,15 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
bool _authenticated;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPSCRAMAuth with an authcid and password.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPSCRAMAuth with an authcid and password.
|
||||
*
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \param connection The connection over which authentication is done
|
||||
* \param hash The class to use for calulating hashes
|
||||
* \param plusAvailable Whether the PLUS variant was offered
|
||||
* \return A new autoreleased XMPPSCRAMAuth
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @param connection The connection over which authentication is done
|
||||
* @param hash The class to use for calulating hashes
|
||||
* @param plusAvailable Whether the PLUS variant was offered
|
||||
* @return A new autoreleased XMPPSCRAMAuth
|
||||
*/
|
||||
+ (instancetype)SCRAMAuthWithAuthcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password
|
||||
|
@ -57,17 +57,17 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
hash: (Class)hash
|
||||
plusAvailable: (bool)plusAvailable;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and
|
||||
* password.
|
||||
*
|
||||
* \param authzid The authzid to get authorization for
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \param connection The connection over which authentication is done
|
||||
* \param hash The class to use for calulating hashes
|
||||
* \param plusAvailable Whether the PLUS variant was offered
|
||||
* \return A new autoreleased XMPPSCRAMAuth
|
||||
* @param authzid The authzid to get authorization for
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @param connection The connection over which authentication is done
|
||||
* @param hash The class to use for calulating hashes
|
||||
* @param plusAvailable Whether the PLUS variant was offered
|
||||
* @return A new autoreleased XMPPSCRAMAuth
|
||||
*/
|
||||
+ (instancetype)SCRAMAuthWithAuthzid: (nullable OFString *)authzid
|
||||
authcid: (nullable OFString *)authcid
|
||||
|
@ -82,16 +82,16 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
authcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPSCRAMAuth with an authcid and
|
||||
* password.
|
||||
*
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \param connection The connection over which authentication is done
|
||||
* \param hash The class to use for calulating hashes
|
||||
* \param plusAvailable Whether the PLUS variant was offered
|
||||
* \return A initialized XMPPSCRAMAuth
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @param connection The connection over which authentication is done
|
||||
* @param hash The class to use for calulating hashes
|
||||
* @param plusAvailable Whether the PLUS variant was offered
|
||||
* @return A initialized XMPPSCRAMAuth
|
||||
*/
|
||||
- initWithAuthcid: (nullable OFString *)authcid
|
||||
password: (nullable OFString *)password
|
||||
|
@ -99,17 +99,17 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
hash: (Class)hash
|
||||
plusAvailable: (bool)plusAvailable;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPSCRAMAuth with a authzid,
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPSCRAMAuth with a authzid,
|
||||
* authcid and password.
|
||||
*
|
||||
* \param authzid The authzid to get authorization for
|
||||
* \param authcid The authcid to authenticate with
|
||||
* \param password The password to authenticate with
|
||||
* \param connection The connection over which authentication is done
|
||||
* \param hash The class to use for calulating hashes
|
||||
* \param plusAvailable Whether the PLUS variant was offered
|
||||
* \return A initialized XMPPSCRAMAuth
|
||||
* @param authzid The authzid to get authorization for
|
||||
* @param authcid The authcid to authenticate with
|
||||
* @param password The password to authenticate with
|
||||
* @param connection The connection over which authentication is done
|
||||
* @param hash The class to use for calulating hashes
|
||||
* @param plusAvailable Whether the PLUS variant was offered
|
||||
* @return A initialized XMPPSCRAMAuth
|
||||
*/
|
||||
- initWithAuthzid: (nullable OFString *)authzid
|
||||
authcid: (nullable OFString *)authcid
|
||||
|
|
124
src/XMPPStanza.h
124
src/XMPPStanza.h
|
@ -27,8 +27,8 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@class XMPPJID;
|
||||
|
||||
/**
|
||||
* \brief A class describing an XMPP Stanza.
|
||||
/*!
|
||||
* @brief A class describing an XMPP Stanza.
|
||||
*/
|
||||
@interface XMPPStanza: OFXMLElement
|
||||
{
|
||||
|
@ -36,64 +36,78 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
OFString *_type, *_ID, *_language;
|
||||
}
|
||||
|
||||
/// \brief The value of the stanza's from attribute
|
||||
/*!
|
||||
* The value of the stanza's from attribute.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) XMPPJID *from;
|
||||
/// \brief The value of the stanza's to attribute
|
||||
|
||||
/*!
|
||||
* The value of the stanza's to attribute.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) XMPPJID *to;
|
||||
/// \brief The value of the stanza's type attribute
|
||||
|
||||
/*!
|
||||
* The value of the stanza's type attribute.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *type;
|
||||
/// \brief The value of the stanza's id attribute
|
||||
|
||||
/*!
|
||||
* The value of the stanza's id attribute.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *ID;
|
||||
/// \brief The stanza's xml:lang
|
||||
|
||||
/*!
|
||||
* The stanza's xml:lang.
|
||||
*/
|
||||
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *language;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPStanza with the specified name.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPStanza with the specified name.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \return A new autoreleased XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @return A new autoreleased XMPPStanza
|
||||
*/
|
||||
+ (instancetype)stanzaWithName: (OFString *)name;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPStanza with the specified name and
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPStanza with the specified name and
|
||||
* type.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A new autoreleased XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A new autoreleased XMPPStanza
|
||||
*/
|
||||
+ (instancetype)stanzaWithName: (OFString *)name
|
||||
type: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPStanza with the specified name and ID.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPStanza with the specified name and ID.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPStanza
|
||||
*/
|
||||
+ (instancetype)stanzaWithName: (OFString *)name
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPStanza with the specified name, type
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPStanza with the specified name, type
|
||||
* and ID.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A new autoreleased XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A new autoreleased XMPPStanza
|
||||
*/
|
||||
+ (instancetype)stanzaWithName: (OFString *)name
|
||||
type: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Creates a new autoreleased XMPPStanza from an OFXMLElement.
|
||||
/*!
|
||||
* @brief Creates a new autoreleased XMPPStanza from an OFXMLElement.
|
||||
*
|
||||
* \param element The element to base the XMPPStanza on
|
||||
* \return A new autoreleased XMPPStanza
|
||||
* @param element The element to base the XMPPStanza on
|
||||
* @return A new autoreleased XMPPStanza
|
||||
*/
|
||||
+ (instancetype)stanzaWithElement: (OFXMLElement *)element;
|
||||
|
||||
|
@ -107,54 +121,54 @@ OF_ASSUME_NONNULL_BEGIN
|
|||
- initWithXMLString: (OFString *)string OF_UNAVAILABLE;
|
||||
- initWithFile: (OFString *)path OF_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStanza with the specified name.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStanza with the specified name.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \return A initialized XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @return A initialized XMPPStanza
|
||||
*/
|
||||
- initWithName: (OFString *)name;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStanza with the specified name
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStanza with the specified name
|
||||
* and type.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \return A initialized XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @return A initialized XMPPStanza
|
||||
*/
|
||||
- initWithName: (OFString *)name
|
||||
type: (nullable OFString *)type;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStanza with the specified name
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStanza with the specified name
|
||||
* and ID.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPStanza
|
||||
*/
|
||||
- initWithName: (OFString *)name
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStanza with the specified name,
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStanza with the specified name,
|
||||
* type and ID.
|
||||
*
|
||||
* \param name The stanza's name (one of iq, message or presence)
|
||||
* \param type The value for the stanza's type attribute
|
||||
* \param ID The value for the stanza's id attribute
|
||||
* \return A initialized XMPPStanza
|
||||
* @param name The stanza's name (one of iq, message or presence)
|
||||
* @param type The value for the stanza's type attribute
|
||||
* @param ID The value for the stanza's id attribute
|
||||
* @return A initialized XMPPStanza
|
||||
*/
|
||||
- initWithName: (OFString *)name
|
||||
type: (nullable OFString *)type
|
||||
ID: (nullable OFString *)ID;
|
||||
|
||||
/**
|
||||
* \brief Initializes an already allocated XMPPStanza based on a OFXMLElement.
|
||||
/*!
|
||||
* @brief Initializes an already allocated XMPPStanza based on a OFXMLElement.
|
||||
*
|
||||
* \param element The element to base the XMPPStanza on
|
||||
* \return A initialized XMPPStanza
|
||||
* @param element The element to base the XMPPStanza on
|
||||
* @return A initialized XMPPStanza
|
||||
*/
|
||||
- initWithElement: (OFXMLElement *)element;
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue