1
2
3
4
5
6
7
8
9
10
11
12
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
+
-
+
|
/*
* Copyright (c) 2010, 2011, 2012, Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2010, 2011, 2012, 2013, 2016
* Jonathan Schleifer <js@heap.zone>
* Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
-
-
-
|
* \brief A protocol that should be (partially) implemented
* by delegates of a XMPPConnection
*/
@protocol XMPPConnectionDelegate
#ifndef XMPP_CONNECTION_M
<OFObject>
#endif
#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
/**
* \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
*/
- (void)connection: (XMPPConnection*)connection
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
-
+
-
-
+
-
|
*/
- (void)connectionDidUpgradeToTLS: (XMPPConnection*)connection;
@end
/**
* \brief A class which abstracts a connection to an XMPP service.
*/
@interface XMPPConnection: OFObject
@interface XMPPConnection: OFObject <OFXMLParserDelegate,
#ifdef OF_HAVE_OPTONAL_PROTOCOLS
<OFXMLParserDelegate, OFXMLElementBuilderDelegate>
OFXMLElementBuilderDelegate>
#endif
{
id _socket;
OFXMLParser *_parser, *_oldParser;
OFXMLElementBuilder *_elementBuilder, *_oldElementBuilder;
OFString *_username, *_password, *_server, *_resource;
OFString *_privateKeyFile, *_certificateFile;
const char *_privateKeyPassphrase;
|
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
-
|
bool _needsSession;
bool _encryptionRequired, _encrypted;
bool _supportsRosterVersioning;
bool _supportsStreamManagement;
unsigned int _lastID;
}
#ifdef OF_HAVE_PROPERTIES
/// \brief The username to use for authentication
@property (copy) OFString *username;
/// \brief The password to use for authentication
@property (copy) OFString *password;
/**
* \brief The server to use for the connection
*
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
-
|
@property bool encryptionRequired;
/// \brief Whether the connection is encrypted
@property (readonly) bool encrypted;
/// \brief Whether roster versioning is supported
@property (readonly) bool supportsRosterVersioning;
/// \brief Whether stream management is supported
@property (readonly) bool supportsStreamManagement;
#endif
/**
* \brief Creates a new autoreleased XMPPConnection.
*
* \return A new autoreleased XMPPConnection
*/
+ (instancetype)connection;
|