mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	refactor: Move by_conversation_and_time_uri to hash_util.
This removes the 100% coverage on hash_util, but we are pretty careful about not messing with this code.
This commit is contained in:
		@@ -106,6 +106,29 @@ 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];
 | 
			
		||||
    }
 | 
			
		||||
    if (message.type === "stream") {
 | 
			
		||||
        return absolute_url + "#narrow/stream/" +
 | 
			
		||||
            exports.encode_stream_name(message.stream) +
 | 
			
		||||
            "/subject/" + exports.encodeHashComponent(message.subject) +
 | 
			
		||||
            "/near/" + exports.encodeHashComponent(message.id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Include your own email in this URI if it's not there already
 | 
			
		||||
    var all_emails = message.reply_to;
 | 
			
		||||
    if (all_emails.indexOf(people.my_current_email()) === -1) {
 | 
			
		||||
        all_emails += "," + people.my_current_email();
 | 
			
		||||
    }
 | 
			
		||||
    return absolute_url + "#narrow/pm-with/" +
 | 
			
		||||
        exports.encodeHashComponent(all_emails) +
 | 
			
		||||
        "/near/" + exports.encodeHashComponent(message.id);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
return exports;
 | 
			
		||||
 | 
			
		||||
}());
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user