mirror of https://github.com/zulip/zulip.git
Return absolute URL from narrow.by_conversation_and_time_uri
This commit is contained in:
parent
4971b7ff9f
commit
6fe0728afa
|
@ -564,13 +564,20 @@ exports.by_near_uri = function (message_id) {
|
|||
return "#narrow/near/" + hash_util.encodeHashComponent(message_id);
|
||||
};
|
||||
|
||||
exports.by_conversation_and_time_uri = function (message) {
|
||||
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];
|
||||
}
|
||||
if (message.type === "stream") {
|
||||
return "#narrow/stream/" + hash_util.encodeHashComponent(message.stream) +
|
||||
return absolute_url + "#narrow/stream/" +
|
||||
hash_util.encodeHashComponent(message.stream) +
|
||||
"/subject/" + hash_util.encodeHashComponent(message.subject) +
|
||||
"/near/" + hash_util.encodeHashComponent(message.id);
|
||||
}
|
||||
return "#narrow/pm-with/" + hash_util.encodeHashComponent(message.reply_to) +
|
||||
return absolute_url + "#narrow/pm-with/" +
|
||||
hash_util.encodeHashComponent(message.reply_to) +
|
||||
"/near/" + hash_util.encodeHashComponent(message.id);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue