@@ -373,3 +373,63 @@ class UpdateMessageFlagsForNarrowResult {
373
373
374
374
Map <String , dynamic > toJson () => _$UpdateMessageFlagsForNarrowResultToJson (this );
375
375
}
376
+
377
+ /// https://zulip.com/api/mark-all-as-read
378
+ ///
379
+ /// This binding is deprecated, in FL 155+ use
380
+ /// [updateMessageFlagsForNarrow] instead.
381
+ // TODO(server-6): Remove as deprecated by updateMessageFlagsForNarrow
382
+ //
383
+ // For FL < 153 this call was atomic on the server and would
384
+ // not mark any messages as read if it timed out.
385
+ // From FL 153 and onward the server started processing
386
+ // in batches so progress could still be made in the event
387
+ // of a timeout interruption. Thus, in FL 153 this call
388
+ // started returning `result: partially_completed` and
389
+ // `code: REQUEST_TIMEOUT` for timeouts.
390
+ //
391
+ // In FL 211 the `partially_completed` variant of
392
+ // `result` was removed, the string `code` field also
393
+ // removed, and a boolean `complete` field introduced.
394
+ //
395
+ // For full support of this endpoint we would need three
396
+ // variants of the return structure based on feature
397
+ // level (`{}`, `{code: string}`, and `{complete: bool}`)
398
+ // as well as handling of `partially_completed` variant
399
+ // of `result` in `lib/api/core.dart`. For simplicity we
400
+ // ignore these return values.
401
+ //
402
+ // We don't use this method for FL 155+ (it is replaced
403
+ // by `updateMessageFlagsForNarrow`) so there are only
404
+ // two versions (FL 153 and FL 154) affected.
405
+ Future <void > markAllAsRead (ApiConnection connection) {
406
+ return connection.post ('markAllAsRead' , (_) {}, 'mark_all_as_read' , {});
407
+ }
408
+
409
+ /// https://zulip.com/api/mark-stream-as-read
410
+ ///
411
+ /// This binding is deprecated, in FL 155+ use
412
+ /// [updateMessageFlagsForNarrow] instead.
413
+ // TODO(server-6): Remove as deprecated by updateMessageFlagsForNarrow
414
+ Future <void > markStreamAsRead (ApiConnection connection, {
415
+ required int streamId,
416
+ }) {
417
+ return connection.post ('markStreamAsRead' , (_) {}, 'mark_stream_as_read' , {
418
+ 'stream_id' : streamId,
419
+ });
420
+ }
421
+
422
+ /// https://zulip.com/api/mark-topic-as-read
423
+ ///
424
+ /// This binding is deprecated, in FL 155+ use
425
+ /// [updateMessageFlagsForNarrow] instead.
426
+ // TODO(server-6): Remove as deprecated by updateMessageFlagsForNarrow
427
+ Future <void > markTopicAsRead (ApiConnection connection, {
428
+ required int streamId,
429
+ required String topicName,
430
+ }) {
431
+ return connection.post ('markTopicAsRead' , (_) {}, 'mark_topic_as_read' , {
432
+ 'stream_id' : streamId,
433
+ 'topic_name' : RawParameter (topicName),
434
+ });
435
+ }
0 commit comments