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