ObjXMPP  Check-in [4e3a1310e6]

Overview
Comment:Fix compilation with GCC
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4e3a1310e63850adde9ff4de988a6fe1b8753ec836011a4b6449e107dd613557
User & Date: js on 2018-11-05 22:02:42
Other Links: manifest | tags
Context
2018-11-05
22:30
Kill #ifdef HAVE_CONFIG_H check-in: cd21ff1157 user: js tags: trunk
22:02
Fix compilation with GCC check-in: 4e3a1310e6 user: js tags: trunk
21:22
Modernize coding style check-in: 180bf3d08b user: js tags: trunk
Changes

Modified src/XMPPConnection.h from [abb0306b65] to [9de35f3a6c].

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*!
 * @brief This callback is called when the connection threw an exception.
 *
 * @param connection The connection which threw an exception
 * @param exception The exception the connection threw
 */
-  (void)connection: (XMPPConnection *)connection
  didThrowException: (OFException *)exception;

/*!
 * @brief This callback is called when the connection is about to upgrade to
 *	  TLS.
 *
 * @param connection The connection that will upgraded to TLS
 */







|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*!
 * @brief This callback is called when the connection threw an exception.
 *
 * @param connection The connection which threw an exception
 * @param exception The exception the connection threw
 */
-  (void)connection: (XMPPConnection *)connection
  didThrowException: (id)exception;

/*!
 * @brief This callback is called when the connection is about to upgrade to
 *	  TLS.
 *
 * @param connection The connection that will upgraded to TLS
 */
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

/*!
 * @brief A class which abstracts a connection to an XMPP service.
 */
@interface XMPPConnection: OFObject <OFXMLParserDelegate,
    OFXMLElementBuilderDelegate>
{
	id _socket;
	OFXMLParser *_parser, *_oldParser;
	OFXMLElementBuilder *_elementBuilder, *_oldElementBuilder;
	OFString *_username, *_password, *_server, *_resource;
	OFString *_privateKeyFile, *_certificateFile;
	const char *_privateKeyPassphrase;
	OFString *_domain, *_domainToASCII;
	XMPPJID *_JID;







|







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

/*!
 * @brief A class which abstracts a connection to an XMPP service.
 */
@interface XMPPConnection: OFObject <OFXMLParserDelegate,
    OFXMLElementBuilderDelegate>
{
	OF_KINDOF(OFTCPSocket *) _socket;
	OFXMLParser *_parser, *_oldParser;
	OFXMLElementBuilder *_elementBuilder, *_oldElementBuilder;
	OFString *_username, *_password, *_server, *_resource;
	OFString *_privateKeyFile, *_certificateFile;
	const char *_privateKeyPassphrase;
	OFString *_domain, *_domainToASCII;
	XMPPJID *_JID;
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
 * An object for data storage, conforming to the XMPPStorage protocol.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, assign) id <XMPPStorage> dataStorage;

/*!
 * The socket used for the connection.
 */
@property (readonly, nonatomic) OFTCPSocket *socket;

/*!
 * Whether encryption is required.
 */
@property (nonatomic) bool encryptionRequired;

/*!







|







222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
 * An object for data storage, conforming to the XMPPStorage protocol.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, assign) id <XMPPStorage> dataStorage;

/*!
 * The socket used for the connection.
 */
@property (readonly, nonatomic) OF_KINDOF(OFTCPSocket *) socket;

/*!
 * Whether encryption is required.
 */
@property (nonatomic) bool encryptionRequired;

/*!

Modified src/XMPPConnection.m from [b5eb472034] to [a424bde566].

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
				     IQ: (XMPPIQ *)IQ;
- (OFString *)xmpp_IDNAToASCII: (OFString *)domain;
- (XMPPMulticastDelegate *)xmpp_delegates;
@end

@implementation XMPPConnection
@synthesize username = _username, resource = _resource, server = _server;
@synthesize domain = _domain, password = _password, language = _language;
@synthesize privateKeyFile = _privateKeyFile;
@synthesize certificateFile = _certificateFile, socket = _socket;
@synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted;
@synthesize supportsRosterVersioning = _supportsRosterVersioning;
@synthesize supportsStreamManagement = _supportsStreamManagement;

+ (instancetype)connection
{







|
|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
				     IQ: (XMPPIQ *)IQ;
- (OFString *)xmpp_IDNAToASCII: (OFString *)domain;
- (XMPPMulticastDelegate *)xmpp_delegates;
@end

@implementation XMPPConnection
@synthesize username = _username, resource = _resource, server = _server;
@synthesize domain = _domain, password = _password, JID = _JID, port = _port;
@synthesize language = _language, privateKeyFile = _privateKeyFile;
@synthesize certificateFile = _certificateFile, socket = _socket;
@synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted;
@synthesize supportsRosterVersioning = _supportsRosterVersioning;
@synthesize supportsStreamManagement = _supportsStreamManagement;

+ (instancetype)connection
{

Modified src/XMPPContact.m from [fbc7c24c31] to [b77733fbe8].

19
20
21
22
23
24
25

26
27

28
29
30
31
32
33
34
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPContact.h"
#import "XMPPContact+Private.h"

#import "XMPPMessage.h"
#import "XMPPConnection.h"


@implementation XMPPContact
@synthesize rosterItem = _rosterItem;
@synthesize presences = _presences;

- (instancetype)init
{







>
|
|
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPContact.h"
#import "XMPPContact+Private.h"
#import "XMPPConnection.h"
#import "XMPPJID.h"
#import "XMPPMessage.h"
#import "XMPPRosterItem.h"

@implementation XMPPContact
@synthesize rosterItem = _rosterItem;
@synthesize presences = _presences;

- (instancetype)init
{

Modified src/XMPPContactManager.m from [5c8553fb32] to [44efae0635].

21
22
23
24
25
26
27

28
29
30
31
32
33
34
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPContactManager.h"
#import "XMPPContact.h"
#import "XMPPContact+Private.h"
#import "XMPPJID.h"

#import "XMPPMulticastDelegate.h"
#import "XMPPPresence.h"
#import "XMPPRosterItem.h"

@implementation XMPPContactManager
@synthesize contacts = _contacts;








>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPContactManager.h"
#import "XMPPContact.h"
#import "XMPPContact+Private.h"
#import "XMPPJID.h"
#import "XMPPMessage.h"
#import "XMPPMulticastDelegate.h"
#import "XMPPPresence.h"
#import "XMPPRosterItem.h"

@implementation XMPPContactManager
@synthesize contacts = _contacts;

Modified src/XMPPDiscoEntity.m from [90e2de8bd2] to [d5ee52dfea].

18
19
20
21
22
23
24

25
26
27
28
29
30
31
32













33
34
35
36
37
38
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54
55
56
57






58
59
60
61
62
63
64
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPDiscoEntity.h"

#import "XMPPDiscoNode.h"
#import "XMPPDiscoNode+Private.h"
#import "XMPPDiscoIdentity.h"
#import "XMPPIQ.h"
#import "namespaces.h"

@implementation XMPPDiscoEntity
@synthesize discoNodes = _discoNodes, capsNode = _capsNode;














+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection
{
	return [[[self alloc] initWithConnection: connection] autorelease];
}

+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection
				 capsNode: (OFString *)capsNode
{
	return [[[self alloc] initWithConnection: connection
					capsNode: capsNode] autorelease];
}

- (instancetype)initWithConnection: (XMPPConnection *)connection

{
	return [self initWithConnection: connection
			       capsNode: nil];
}

- (instancetype)initWithJID: (XMPPJID *)JID
		       node: (nullable OFString *)node
		       name: (nullable OFString *)name
{
	OF_INVALID_INIT_METHOD
}







- (instancetype)initWithConnection: (XMPPConnection *)connection
			  capsNode: (OFString *)capsNode
{
	self = [super initWithJID: [connection JID]
			     node: nil
			     name: nil];







>


|
|




>
>
>
>
>
>
>
>
>
>
>
>
>













|
>

<
|








>
>
>
>
>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPDiscoEntity.h"
#import "XMPPDiscoIdentity.h"
#import "XMPPDiscoNode.h"
#import "XMPPDiscoNode+Private.h"
#import "XMPPIQ.h"
#import "XMPPJID.h"
#import "namespaces.h"

@implementation XMPPDiscoEntity
@synthesize discoNodes = _discoNodes, capsNode = _capsNode;

+ (instancetype)discoNodeWithJID: (XMPPJID *)JID
			    node: (OFString *)node
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (instancetype)discoNodeWithJID: (XMPPJID *)JID
			    node: (OFString *)node
			    name: (OFString *)name
{
	OF_UNRECOGNIZED_SELECTOR
}

+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection
{
	return [[[self alloc] initWithConnection: connection] autorelease];
}

+ (instancetype)discoEntityWithConnection: (XMPPConnection *)connection
				 capsNode: (OFString *)capsNode
{
	return [[[self alloc] initWithConnection: connection
					capsNode: capsNode] autorelease];
}

- (instancetype)initWithJID: (XMPPJID *)JID
		       node: (nullable OFString *)node
{

	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithJID: (XMPPJID *)JID
		       node: (nullable OFString *)node
		       name: (nullable OFString *)name
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithConnection: (XMPPConnection *)connection
{
	return [self initWithConnection: connection
			       capsNode: nil];
}

- (instancetype)initWithConnection: (XMPPConnection *)connection
			  capsNode: (OFString *)capsNode
{
	self = [super initWithJID: [connection JID]
			     node: nil
			     name: nil];

Modified src/XMPPPresence.m from [9a279f26c4] to [38b9cdd8c2].

46
47
48
49
50
51
52

53
54
55
56
57
58
59
		return 4;

	OF_ENSURE(0);
}

@implementation XMPPPresence
@dynamic type;


+ (instancetype)presence
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)presenceWithID: (OFString *)ID







>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
		return 4;

	OF_ENSURE(0);
}

@implementation XMPPPresence
@dynamic type;
@synthesize status = _status, show = _show, priority = _priority;

+ (instancetype)presence
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)presenceWithID: (OFString *)ID
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}


- (void)dealloc
{
	[_status release];
	[_show release];
	[_priority release];








<







123
124
125
126
127
128
129

130
131
132
133
134
135
136
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}


- (void)dealloc
{
	[_status release];
	[_show release];
	[_priority release];

Modified src/XMPPSCRAMAuth.m from [b361a2cc27] to [bc4df463a4].

72
73
74
75
76
77
78













79
80
81
82
83
84
85
	return [[[self alloc] initWithAuthzid: authzid
				      authcid: authcid
				     password: password
				   connection: connection
					 hash: hash
				plusAvailable: plusAvailable] autorelease];
}














- (instancetype)initWithAuthcid: (OFString *)authcid
		       password: (OFString *)password
		     connection: (XMPPConnection *)connection
			   hash: (Class)hash
		  plusAvailable: (bool)plusAvailable
{







>
>
>
>
>
>
>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
	return [[[self alloc] initWithAuthzid: authzid
				      authcid: authcid
				     password: password
				   connection: connection
					 hash: hash
				plusAvailable: plusAvailable] autorelease];
}

- (instancetype)initWithAuthcid: (OFString *)authcid
		       password: (OFString *)password
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithAuthzid: (OFString *)authzid
			authcid: (OFString *)authcid
		       password: (OFString *)password
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithAuthcid: (OFString *)authcid
		       password: (OFString *)password
		     connection: (XMPPConnection *)connection
			   hash: (Class)hash
		  plusAvailable: (bool)plusAvailable
{

Modified src/XMPPStanza.m from [5747db70b5] to [a53639c5fa].

61
62
63
64
65
66
67












68
69
70
71
72
73
74
					ID: ID] autorelease];
}

+ (instancetype)stanzaWithElement: (OFXMLElement *)element
{
	return [[[self alloc] initWithElement: element] autorelease];
}













- (instancetype)initWithName: (OFString *)name
		   namespace: (nullable OFString *)namespace
		 stringValue: (nullable OFString *)stringValue
{
	OF_INVALID_INIT_METHOD
}







>
>
>
>
>
>
>
>
>
>
>
>







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
					ID: ID] autorelease];
}

+ (instancetype)stanzaWithElement: (OFXMLElement *)element
{
	return [[[self alloc] initWithElement: element] autorelease];
}

- (instancetype)initWithName: (OFString *)name
		 stringValue: (OFString *)stringValue
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithName: (OFString *)name
		   namespace: (OFString *)namespace
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)initWithName: (OFString *)name
		   namespace: (nullable OFString *)namespace
		 stringValue: (nullable OFString *)stringValue
{
	OF_INVALID_INIT_METHOD
}