@@ -1,10 +1,11 @@ /* - * Copyright (c) 2010, 2011, 2012, Jonathan Schleifer + * Copyright (c) 2010, 2011, 2012, 2013, 2015, 2016 + * Jonathan Schleifer * Copyright (c) 2011, 2012, Florian Zeitz * - * https://webkeks.org/git/?p=objxmpp.git + * https://heap.zone/git/?p=objxmpp.git * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice is present in all copies. * @@ -115,10 +116,16 @@ return nil; } @end @implementation XMPPConnection +@synthesize language = _language, privateKeyFile = _privateKeyFile; +@synthesize certificateFile = _certificateFile, socket = _socket; +@synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted; +@synthesize supportsRosterVersioning = _supportsRosterVersioning; +@synthesize supportsStreamManagement = _supportsStreamManagement; + + (instancetype)connection { return [[[self alloc] init] autorelease]; } @@ -303,30 +310,10 @@ - (OFString*)password { return [[_password copy] autorelease]; } -- (void)setPrivateKeyFile: (OFString*)privateKeyFile -{ - OF_SETTER(_privateKeyFile, privateKeyFile, true, 1) -} - -- (OFString*)privateKeyFile -{ - OF_GETTER(_privateKeyFile, true) -} - -- (void)setCertificateFile: (OFString*)certificateFile -{ - OF_SETTER(_certificateFile, certificateFile, true, 1) -} - -- (OFString*)certificateFile -{ - OF_GETTER(_certificateFile, true) -} - - (void)connect { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; XMPPSRVEntry *candidate = nil; XMPPSRVLookup *SRVLookup = nil; @@ -475,45 +462,15 @@ } return true; } -- (OFTCPSocket*)socket -{ - return [[_socket retain] autorelease]; -} - -- (bool)encryptionRequired -{ - return _encryptionRequired; -} - -- (void)setEncryptionRequired: (bool)encryptionRequired -{ - _encryptionRequired = encryptionRequired; -} - -- (bool)encrypted -{ - return _encrypted; -} - - (bool)streamOpen { return _streamOpen; } -- (bool)supportsRosterVersioning -{ - return _supportsRosterVersioning; -} - -- (bool)supportsStreamManagement -{ - return _supportsStreamManagement; -} - - (bool)checkCertificateAndGetReason: (OFString**)reason { X509Certificate *cert; OFDictionary *SANs; bool serviceSpecific = false; @@ -1253,25 +1210,10 @@ } return ret; } -- (XMPPJID*)JID -{ - return [[_JID copy] autorelease]; -} - -- (void)setPort: (uint16_t)port -{ - _port = port; -} - -- (uint16_t)port -{ - return _port; -} - - (void)setDataStorage: (id )dataStorage { if (_streamOpen) /* FIXME: Find a better exception! */ @throw [OFInvalidArgumentException exception]; @@ -1282,20 +1224,10 @@ - (id )dataStorage { return _dataStorage; } -- (void)setLanguage: (OFString*)language -{ - OF_SETTER(_language, language, true, 1) -} - -- (OFString*)language -{ - OF_GETTER(_language, true) -} - - (void)addDelegate: (id )delegate { [_delegates addDelegate: delegate]; }