mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
refactor: Move huddle_with_uri to hash_util.
This commit is contained in:
@@ -64,7 +64,7 @@ run_test('uris', () => {
|
|||||||
var uri = hash_util.pm_with_uri(ray.email);
|
var uri = hash_util.pm_with_uri(ray.email);
|
||||||
assert.equal(uri, '#narrow/pm-with/22-ray');
|
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');
|
assert.equal(uri, '#narrow/pm-with/22,23-group');
|
||||||
|
|
||||||
uri = narrow.by_sender_uri(ray.email);
|
uri = narrow.by_sender_uri(ray.email);
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ exports.update_huddles = function () {
|
|||||||
return {
|
return {
|
||||||
user_ids_string: huddle,
|
user_ids_string: huddle,
|
||||||
name: exports.full_huddle_name(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),
|
fraction_present: exports.huddle_fraction_present(huddle),
|
||||||
short_name: exports.short_huddle_name(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;
|
return exports;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -767,14 +767,6 @@ exports.hide_empty_narrow_message = function () {
|
|||||||
$(".empty_feed_notice").hide();
|
$(".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) {
|
exports.by_sender_uri = function (reply_to) {
|
||||||
return hash_util.operators_to_hash([
|
return hash_util.operators_to_hash([
|
||||||
{operator: 'sender', operand: reply_to},
|
{operator: 'sender', operand: reply_to},
|
||||||
|
|||||||
Reference in New Issue
Block a user