Clean up the code.

This commit is contained in:
Jonathan Schleifer 2011-02-16 21:05:14 +01:00
parent fa59d3ce32
commit 4690b47ae9
11 changed files with 186 additions and 184 deletions

View file

@ -1,8 +1,7 @@
#import <ObjFW/ObjFW.h>
#import "XMPPJID.h"
@class XMPPConnection;
@class XMPPJID;
@class XMPPIQ;
@class XMPPMessage;
@class XMPPPresence;
@ -18,47 +17,26 @@
@end
/**
* \brief A class that abstracts a connection to an XMPP service
* \brief A class which abstracts a connection to an XMPP service.
*/
@interface XMPPConnection: OFObject <OFXMLElementBuilderDelegate>
{
OFTCPSocket *sock;
OFXMLParser *parser;
OFXMLElementBuilder *elementBuilder;
/**
* The username to connect with
*/
/// The username to connect with
OFString *username;
/**
* The password to connect with
*/
/// The password to connect with
OFString *password;
/**
* The server to connect to
*/
/// The server to connect to
OFString *server;
/**
* The resource to connect with
*/
/// The resource to connect with
OFString *resource;
/**
* The JID bound to this connection (this is determined by the server)
*/
/// The JID bound to this connection (this is determined by the server)
XMPPJID *JID;
/**
* The port to connect to
*/
/// The port to connect to
short port;
/**
* Whether to use TLS
*/
/// Whether to use TLS
BOOL useTLS;
id <XMPPConnectionDelegate> delegate;
OFMutableArray *mechanisms;
@ -68,23 +46,23 @@
@property (copy) OFString *password;
@property (copy) OFString *server;
@property (copy) OFString *resource;
@property (readonly) XMPPJID *JID;
@property (copy, readonly) XMPPJID *JID;
@property (assign) short port;
@property (assign) BOOL useTLS;
@property (retain) id <XMPPConnectionDelegate> delegate;
/**
* Connects to the XMPP service
* Connects to the XMPP service.
*/
- (void)connect;
/**
* Starts a loop handling incomming data
* Starts a loop handling incomming data.
*/
- (void)handleConnection;
/**
* Sends a OFXMLElement (usually a XMPPStanza)
* Sends an OFXMLElement, usually an XMPPStanza.
*
* \param elem The element to send
*/