Skip to content

Commit

Permalink
msglist [nfc]: Tighten comments on rendering-only updates
Browse files Browse the repository at this point in the history
Also put them consistently in the terminology found in the API doc.
  • Loading branch information
gnprice committed Aug 3, 2023
1 parent ee01b44 commit 1fc230f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/model/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,12 @@ class MessageListView extends ChangeNotifier {
}

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

Expand Down

0 comments on commit 1fc230f

Please sign in to comment.