Skip to content

Commit 1596022

Browse files
gnpriceKhader-1
authored andcommitted
actions [nfc]: Revise doc comment for updateMessageFlagsStartingFromAnchor
1 parent 75df116 commit 1596022

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lib/widgets/actions.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ Future<void> markNarrowAsUnreadFromMessage(
8282
onFailedTitle: zulipLocalizations.errorMarkAsUnreadFailedTitle);
8383
}
8484

85-
/// Updates message flags by applying given operation `op` using given `flag`
86-
/// the update happens on given `apiNarrow` starting from given `startingAnchor`
85+
/// Add or remove the given flag from the anchor to the end of the narrow,
86+
/// showing feedback to the user on progress or failure.
8787
///
88-
/// This also handles interactions with the user as it shows a `Snackbar` with
89-
/// `progressMessage` while performing the update, shows an error dialog when
90-
/// update fails with the given title using `onFailedTitle` and shows
91-
/// a `Snackbar` with computed message using given `onCompletedMessage`.
88+
/// This has the semantics of [updateMessageFlagsForNarrow]
89+
/// (see https://zulip.com/api/update-message-flags-for-narrow)
90+
/// with `numBefore: 0` and infinite `numAfter`. It operates by calling that
91+
/// endpoint with a finite `numAfter` as a batch size, in a loop.
9292
///
93-
/// Returns true in case the process is completed with no exceptions
94-
/// otherwise shows an error dialog and returns false.
93+
/// If the operation requires more than one batch, the user is shown progress
94+
/// feedback through [SnackBar], using [progressMessage] and [onCompletedMessage].
95+
/// If the operation fails, the user is shown an error dialog box with title
96+
/// [onFailedTitle].
97+
///
98+
/// Returns true just if the operation finished successfully.
9599
Future<bool> updateMessageFlagsStartingFromAnchor({
96100
required BuildContext context,
97101
required List<ApiNarrowElement> apiNarrow,

0 commit comments

Comments
 (0)