Skip to content

Commit 1fc230f

Browse files
committed
msglist [nfc]: Tighten comments on rendering-only updates
Also put them consistently in the terminology found in the API doc.
1 parent ee01b44 commit 1fc230f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/model/message_list.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,12 @@ class MessageListView extends ChangeNotifier {
8888
}
8989

9090
_applyChangesToMessage(UpdateMessageEvent event, Message message) {
91-
// In earlier server versions, omitting the userId indicates that this is a
92-
// rendering-only update. That means this change was initiated by the server,
93-
// not the user.
94-
//
9591
// TODO(server-5): Cut this fallback; rely on renderingOnly from FL 114
9692
final isRenderingOnly = event.renderingOnly ?? (event.userId == null);
9793
if (event.editTimestamp != null && !isRenderingOnly) {
98-
// Only update the timestamp if this was a user-led update,
99-
// not a server-only update
94+
// A rendering-only update gets omitted from the message edit history,
95+
// and [Message.lastEditTimestamp] is the last timestamp of that history.
96+
// So on a rendering-only update, the timestamp doesn't get updated.
10097
message.lastEditTimestamp = event.editTimestamp;
10198
}
10299

0 commit comments

Comments
 (0)