mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
markdown: Simulate message flags in frontend markdown processor.
This eliminates an annoying bundle of complexity that caused the frontend markdown processor's interface with the rest of Zulip's new message processing code paths being more similar to that of a new message from the server. It also cuts down on code duplication.
This commit is contained in:
@@ -79,20 +79,6 @@ export function set_message_booleans(message) {
|
||||
delete message.flags;
|
||||
}
|
||||
|
||||
export function init_booleans(message) {
|
||||
// This initializes booleans for the local-echo path where
|
||||
// we don't have flags from the server yet. (We want to
|
||||
// explicitly set flags to false to be consistent with other
|
||||
// codepaths.)
|
||||
message.unread = false;
|
||||
message.historical = false;
|
||||
message.starred = false;
|
||||
message.mentioned = false;
|
||||
message.mentioned_me_directly = false;
|
||||
message.collapsed = false;
|
||||
message.alerted = false;
|
||||
}
|
||||
|
||||
export function update_booleans(message, flags) {
|
||||
// When we get server flags for local echo or message edits,
|
||||
// we are vulnerable to race conditions, so only update flags
|
||||
|
||||
Reference in New Issue
Block a user