mirror of https://github.com/zulip/zulip.git
refactor: Move huddle_with_uri to hash_util.
This commit is contained in:
parent
fc62e554ce
commit
a866f3ec17
|
@ -64,7 +64,7 @@ run_test('uris', () => {
|
|||
var uri = hash_util.pm_with_uri(ray.email);
|
||||
assert.equal(uri, '#narrow/pm-with/22-ray');
|
||||
|
||||
uri = narrow.huddle_with_uri("22,23");
|
||||
uri = hash_util.huddle_with_uri("22,23");
|
||||
assert.equal(uri, '#narrow/pm-with/22,23-group');
|
||||
|
||||
uri = narrow.by_sender_uri(ray.email);
|
||||
|
|
|
@ -276,7 +276,7 @@ exports.update_huddles = function () {
|
|||
return {
|
||||
user_ids_string: huddle,
|
||||
name: exports.full_huddle_name(huddle),
|
||||
href: narrow.huddle_with_uri(huddle),
|
||||
href: hash_util.huddle_with_uri(huddle),
|
||||
fraction_present: exports.huddle_fraction_present(huddle),
|
||||
short_name: exports.short_huddle_name(huddle),
|
||||
};
|
||||
|
|
|
@ -92,6 +92,14 @@ exports.pm_with_uri = function (reply_to) {
|
|||
]);
|
||||
};
|
||||
|
||||
exports.huddle_with_uri = function (user_ids_string) {
|
||||
// This method is convenient for callers
|
||||
// that have already converted emails to a comma-delimited
|
||||
// list of user_ids. We should be careful to keep this
|
||||
// consistent with hash_util.decode_operand.
|
||||
return "#narrow/pm-with/" + user_ids_string + '-group';
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
}());
|
||||
|
|
|
@ -767,14 +767,6 @@ exports.hide_empty_narrow_message = function () {
|
|||
$(".empty_feed_notice").hide();
|
||||
};
|
||||
|
||||
exports.huddle_with_uri = function (user_ids_string) {
|
||||
// This method is convenient is convenient for callers
|
||||
// that have already converted emails to a comma-delimited
|
||||
// list of user_ids. We should be careful to keep this
|
||||
// consistent with hash_util.decode_operand.
|
||||
return "#narrow/pm-with/" + user_ids_string + '-group';
|
||||
};
|
||||
|
||||
exports.by_sender_uri = function (reply_to) {
|
||||
return hash_util.operators_to_hash([
|
||||
{operator: 'sender', operand: reply_to},
|
||||
|
|
Loading…
Reference in New Issue