ObjMatrix  Diff

Differences From Artifact [a9c991a2fb]:

To Artifact [4640a34e7e]:


40
41
42
43
44
45
46







47
48
49
50
51
52
53
/**
 * @brief A block called when the response for an operation was received.
 *
 * @param exception `nil` on success, otherwise an exception
 */
typedef void (^mtx_client_response_block_t)(id _Nullable exception);








/**
 * @brief A block called when the room list was fetched.
 *
 * @param rooms An array of joined rooms, or nil on error
 * @param exception An exception if fetching the room list failed
 */
typedef void (^mtx_client_room_list_block_t)(







>
>
>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
 * @brief A block called when the response for an operation was received.
 *
 * @param exception `nil` on success, otherwise an exception
 */
typedef void (^mtx_client_response_block_t)(id _Nullable exception);

/**
 * @brief A block called when an exception occurred during sync.
 *
 * @param exception The exception which occurred during sync
 */
typedef void (^mtx_sync_exception_handler_block_t)(id exception);

/**
 * @brief A block called when the room list was fetched.
 *
 * @param rooms An array of joined rooms, or nil on error
 * @param exception An exception if fetching the room list failed
 */
typedef void (^mtx_client_room_list_block_t)(
88
89
90
91
92
93
94













95
96
97
98
99
100
101
@property (readonly, nonatomic) OFURL *homeserver;

/**
 * @brief The storage used by the client.
 */
@property (readonly, nonatomic) id <MTXStorage> storage;














/**
 * @brief Creates a new client with the specified access token on the specified
 *	  homeserver.
 *
 * @param userID The user ID for the client
 * @param deviceID The device ID for the client
 * @param accessToken The access token for the client







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







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@property (readonly, nonatomic) OFURL *homeserver;

/**
 * @brief The storage used by the client.
 */
@property (readonly, nonatomic) id <MTXStorage> storage;

/**
 * @brief The timeout for sync requests.
 *
 * Defaults to 5 minutes.
 */
@property (nonatomic) of_time_interval_t syncTimeout;

/**
 * @brief A block to handle exceptions that occurred during sync.
 */
@property (copy, nonatomic)
    mtx_sync_exception_handler_block_t syncExceptionHandler;

/**
 * @brief Creates a new client with the specified access token on the specified
 *	  homeserver.
 *
 * @param userID The user ID for the client
 * @param deviceID The device ID for the client
 * @param accessToken The access token for the client
139
140
141
142
143
144
145
146
147

148





149
150
151
152
153
154
155
156
157
158
		      deviceID: (OFString *)deviceID
		   accessToken: (OFString *)accessToken
		    homeserver: (OFURL *)homeserver
		       storage: (id <MTXStorage>)storage
    OF_DESIGNATED_INITIALIZER;

/**
 * @brief Performs a sync.
 *

 * @param block A block to call when a sync was performed





 */
- (void)syncWithTimeout: (of_time_interval_t)timeout
		  block: (mtx_client_response_block_t)block;

/**
 * @brief Logs out the device and invalidates the access token.
 *
 * @warning The client can no longer be used after this succeeded!
 *
 * @param block A block to call when logging out succeeded or failed







|
|
>
|
>
>
>
>
>

|
<







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
		      deviceID: (OFString *)deviceID
		   accessToken: (OFString *)accessToken
		    homeserver: (OFURL *)homeserver
		       storage: (id <MTXStorage>)storage
    OF_DESIGNATED_INITIALIZER;

/**
 * @brief Starts the sync loop.
 */
- (void)startSyncLoop;

/**
 * @brief Stops the sync loop.
 *
 * The currently waiting sync is not aborted, but after it returns, no new sync
 * will be started.
 */
- (void)stopSyncLoop;


/**
 * @brief Logs out the device and invalidates the access token.
 *
 * @warning The client can no longer be used after this succeeded!
 *
 * @param block A block to call when logging out succeeded or failed