ObjXMPP  Diff

Differences From Artifact [883bb55bc1]:

To Artifact [abb0306b65]:


1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2016
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above

|







1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2016, 2017, 2018
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param connection The connection that was closed
 */
- (void)connectionWasClosed: (XMPPConnection *)connection;

/*!
 * @brief This callback is called when the connection threw an exception.
 *
 * This is only called for connections on which
 * @ref XMPPConnection::handleConnection has been called.
 *
 * @param connection The connection which threw an exception
 * @param exception The exception the connection threw
 */
-  (void)connection: (XMPPConnection *)connection
  didThrowException: (OFException *)exception;

/*!







<
<
<







112
113
114
115
116
117
118



119
120
121
122
123
124
125
 * @param connection The connection that was closed
 */
- (void)connectionWasClosed: (XMPPConnection *)connection;

/*!
 * @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;

/*!
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/*!
 * @brief Removes the specified delegate.
 *
 * @param delegate The delegate to remove
 */
- (void)removeDelegate: (id <XMPPConnectionDelegate>)delegate;

/*!
 * @brief Connects to the XMPP service.
 */
- (void)connect;

/*!
 * @brief Closes the stream to the XMPP service
 */
- (void)close;

/*!
 * @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
 *		 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
 */
- (bool)checkCertificateAndGetReason:
    (OFString *__autoreleasing _Nonnull *_Nullable)reason;

/*!
 * @brief Adds the connection to the run loop.
 */
- (void)handleConnection;

/*!
 * @brief Asynchronously connects to the server and adds the connection to the
 *	  run loop.
 */
- (void)asyncConnectAndHandle;

/*!
 * @brief Parses the specified buffer.
 *
 * This is useful for handling multiple connections at once.
 *
 * @param buffer The buffer to parse







<
<
<
<
<


















<
<
<
<
<
|
<

|







265
266
267
268
269
270
271





272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289





290

291
292
293
294
295
296
297
298
299
/*!
 * @brief Removes the specified delegate.
 *
 * @param delegate The delegate to remove
 */
- (void)removeDelegate: (id <XMPPConnectionDelegate>)delegate;






/*!
 * @brief Closes the stream to the XMPP service
 */
- (void)close;

/*!
 * @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
 *		 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
 */
- (bool)checkCertificateAndGetReason:
    (OFString *__autoreleasing _Nonnull *_Nullable)reason;

/*!





 * @brief Asynchronously connects to the server.

 */
- (void)asyncConnect;

/*!
 * @brief Parses the specified buffer.
 *
 * This is useful for handling multiple connections at once.
 *
 * @param buffer The buffer to parse