mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
url_preview: Fix 'Edited' notification for url preview events.
Uses the `rendering_only` field in the `update_message` event to filter the addition of `last_edit_timestamp` to the message, which is what triggers the addition of an `Edited` notification when a message is rerendered in the web app. Also, removes the deletion of `msg.last_edit_timestr` since this is regenerated every time the message is rendered, and so it did nothing beyond confusing the code.
This commit is contained in:
committed by
Tim Abbott
parent
cbac466658
commit
c9c980d7b0
@@ -245,7 +245,6 @@ export function update_messages(events) {
|
|||||||
msg.edit_history = [edit_history_entry].concat(msg.edit_history);
|
msg.edit_history = [edit_history_entry].concat(msg.edit_history);
|
||||||
}
|
}
|
||||||
msg.last_edit_timestamp = event.edit_timestamp;
|
msg.last_edit_timestamp = event.edit_timestamp;
|
||||||
delete msg.last_edit_timestr;
|
|
||||||
|
|
||||||
// Remove the recent topics entry for the old topics;
|
// Remove the recent topics entry for the old topics;
|
||||||
// must be called before we call set_message_topic.
|
// must be called before we call set_message_topic.
|
||||||
@@ -415,8 +414,13 @@ export function update_messages(events) {
|
|||||||
msg.raw_content = event.content;
|
msg.raw_content = event.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.last_edit_timestamp = event.edit_timestamp;
|
// Mark the message as edited for the UI. The rendering_only
|
||||||
delete msg.last_edit_timestr;
|
// flag is used to indicated update_message events that are
|
||||||
|
// triggered by server latency optimizations, not user
|
||||||
|
// interactions; these should not generate edit history updates.
|
||||||
|
if (!event.rendering_only) {
|
||||||
|
msg.last_edit_timestamp = event.edit_timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
notifications.received_messages([msg]);
|
notifications.received_messages([msg]);
|
||||||
alert_words.process_message(msg);
|
alert_words.process_message(msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user