mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
edit_history: Use modern edit history format in frontend.
This commit is contained in:
@@ -107,7 +107,7 @@ test("msg_moved_var", () => {
|
||||
}),
|
||||
// topic changed: Move
|
||||
build_message_context({
|
||||
edit_history: [{prev_subject: "test_topic", timestamp: 1000, user_id: 1}],
|
||||
edit_history: [{prev_topic: "test_topic", timestamp: 1000, user_id: 1}],
|
||||
}),
|
||||
// content edited: Edit
|
||||
build_message_context({
|
||||
|
||||
@@ -136,10 +136,6 @@ run_test("get_edit_event_orig_topic", () => {
|
||||
assert.equal(util.get_edit_event_orig_topic({orig_subject: "lunch"}), "lunch");
|
||||
});
|
||||
|
||||
run_test("get_edit_event_prev_topic", () => {
|
||||
assert.equal(util.get_edit_event_prev_topic({prev_subject: "dinner"}), "dinner");
|
||||
});
|
||||
|
||||
run_test("is_mobile", () => {
|
||||
window.navigator = {userAgent: "Android"};
|
||||
assert.ok(util.is_mobile());
|
||||
|
||||
@@ -66,10 +66,7 @@ function message_was_only_moved(message) {
|
||||
if (edit_history_event.prev_content) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
util.get_edit_event_prev_topic(edit_history_event) ||
|
||||
edit_history_event.prev_stream
|
||||
) {
|
||||
if (edit_history_event.prev_topic || edit_history_event.prev_stream) {
|
||||
moved = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ export function toggle_actions_popover(element, id) {
|
||||
(entry) =>
|
||||
entry.prev_content !== undefined ||
|
||||
entry.prev_stream !== undefined ||
|
||||
util.get_edit_event_prev_topic(entry) !== undefined,
|
||||
entry.prev_topic !== undefined,
|
||||
) &&
|
||||
page_params.realm_allow_edit_history &&
|
||||
not_spectator;
|
||||
|
||||
@@ -241,10 +241,6 @@ export function get_edit_event_orig_topic(obj) {
|
||||
return obj.orig_subject;
|
||||
}
|
||||
|
||||
export function get_edit_event_prev_topic(obj) {
|
||||
return obj.prev_subject;
|
||||
}
|
||||
|
||||
export function is_topic_synonym(operator) {
|
||||
return operator === "subject";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user