hash_util: Remove unnecessary parameter is_absolute_url.

is_absolute_url was always true. Removed the conditional also.
This commit is contained in:
Joshua Pan
2018-08-04 15:40:37 -07:00
committed by Tim Abbott
parent fa7b98030b
commit 3a74df17de
3 changed files with 6 additions and 8 deletions

View File

@@ -106,12 +106,10 @@ exports.huddle_with_uri = function (user_ids_string) {
return "#narrow/pm-with/" + user_ids_string + '-group';
};
exports.by_conversation_and_time_uri = function (message, is_absolute_url) {
var absolute_url = "";
if (is_absolute_url) {
absolute_url = window.location.protocol + "//" +
window.location.host + "/" + window.location.pathname.split('/')[1];
}
exports.by_conversation_and_time_uri = function (message) {
var absolute_url = window.location.protocol + "//" +
window.location.host + "/" + window.location.pathname.split('/')[1];
if (message.type === "stream") {
return absolute_url + "#narrow/stream/" +
exports.encode_stream_name(message.stream) +

View File

@@ -354,7 +354,7 @@ exports.toggle_actions_popover = function (element, id) {
should_display_uncollapse: should_display_uncollapse,
should_display_add_reaction_option: message.sent_by_me,
should_display_edit_history_option: should_display_edit_history_option,
conversation_time_uri: hash_util.by_conversation_and_time_uri(message, true),
conversation_time_uri: hash_util.by_conversation_and_time_uri(message),
narrowed: narrow_state.active(),
should_display_delete_option: should_display_delete_option,
should_display_reminder_option: feature_flags.reminders_in_message_action_menu,

View File

@@ -126,7 +126,7 @@ exports.do_set_reminder_for_message = function (msgid, timestamp) {
return;
}
var link_to_msg = hash_util.by_conversation_and_time_uri(message, true);
var link_to_msg = hash_util.by_conversation_and_time_uri(message);
var command = deferred_message_types.reminders.slash_command;
var reminder_timestamp = timestamp;
var custom_msg = message.raw_content + '\n\n[Link to conversation](' + link_to_msg + ')';