diff --git a/static/js/popovers.js b/static/js/popovers.js index 079063ccf9..c59c42e425 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -534,8 +534,8 @@ export function toggle_actions_popover(element, id) { !message_container.is_hidden && not_spectator; const editability = message_edit.get_editability(message); - const is_stream_editable = - message.is_stream && settings_data.user_can_move_messages_between_streams(); + const can_move_message = message_edit.can_move_message(message); + let editability_menu_item; let move_message_menu_item; let view_source_menu_item; @@ -545,10 +545,7 @@ export function toggle_actions_popover(element, id) { if (message.is_stream) { move_message_menu_item = $t({defaultMessage: "Move message"}); } - } else if ( - editability === message_edit.editability_types.TOPIC_ONLY || - is_stream_editable - ) { + } else if (can_move_message) { move_message_menu_item = $t({defaultMessage: "Move message"}); view_source_menu_item = $t({defaultMessage: "View message source"}); } else { diff --git a/static/js/ui_init.js b/static/js/ui_init.js index 9cb1850f41..61c5d8a4f4 100644 --- a/static/js/ui_init.js +++ b/static/js/ui_init.js @@ -144,10 +144,8 @@ function message_hover($message_row) { // But the message edit hover icon is determined by whether the message is still editable const editability = message_edit.get_editability(message); const is_content_editable = editability === message_edit.editability_types.FULL; - const is_stream_editable = - message.is_stream && settings_data.user_can_move_messages_between_streams(); - const can_move_message = - editability === message_edit.editability_types.TOPIC_ONLY || is_stream_editable; + + const can_move_message = message_edit.can_move_message(message); const args = { is_content_editable: is_content_editable && !message.status_message, can_move_message,