mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
refactor: Remove last uses of page_params.email in JS code.
Earlier commits removed all uses of page_params.email outside of people.js, and it turns out we have page_params.user_id, so we don't even need page_params.email for seeding the data.
This commit is contained in:
@@ -18,7 +18,7 @@ global.people.add({
|
|||||||
user_id: 42,
|
user_id: 42,
|
||||||
});
|
});
|
||||||
|
|
||||||
global.people.initialize_current_user('tester@zulip.com');
|
global.people.initialize_current_user(42);
|
||||||
|
|
||||||
var alert_words = require('js/alert_words.js');
|
var alert_words = require('js/alert_words.js');
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ global.people.add({
|
|||||||
user_id: 42,
|
user_id: 42,
|
||||||
});
|
});
|
||||||
|
|
||||||
global.people.initialize_current_user('owner@zulip.com');
|
global.people.initialize_current_user(42);
|
||||||
|
|
||||||
var patched_underscore = _.clone(_);
|
var patched_underscore = _.clone(_);
|
||||||
patched_underscore.debounce = function (f) { return f; };
|
patched_underscore.debounce = function (f) { return f; };
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ var me = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
people.add(me);
|
people.add(me);
|
||||||
people.initialize_current_user(me.email);
|
people.initialize_current_user(me.user_id);
|
||||||
|
|
||||||
function assert_same_operators(result, terms) {
|
function assert_same_operators(result, terms) {
|
||||||
terms = _.map(terms, function (term) {
|
terms = _.map(terms, function (term) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ people.add_in_realm(alice);
|
|||||||
people.add_in_realm(bob);
|
people.add_in_realm(bob);
|
||||||
people.add_in_realm(cindy);
|
people.add_in_realm(cindy);
|
||||||
|
|
||||||
global.people.initialize_current_user(me.email);
|
global.people.initialize_current_user(me.user_id);
|
||||||
|
|
||||||
global.util.execute_early = noop;
|
global.util.execute_early = noop;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ var me = {
|
|||||||
function initialize() {
|
function initialize() {
|
||||||
people.init();
|
people.init();
|
||||||
people.add(me);
|
people.add(me);
|
||||||
people.initialize_current_user(me.email);
|
people.initialize_current_user(me.user_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var bob = {
|
|||||||
function init() {
|
function init() {
|
||||||
people.init();
|
people.init();
|
||||||
people.add(bob);
|
people.add(bob);
|
||||||
people.initialize_current_user(bob.email);
|
people.initialize_current_user(bob.user_id);
|
||||||
}
|
}
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ var people = global.people;
|
|||||||
|
|
||||||
// set up user data
|
// set up user data
|
||||||
people.add(me);
|
people.add(me);
|
||||||
people.initialize_current_user(me.email);
|
people.initialize_current_user(me.user_id);
|
||||||
|
|
||||||
// set up our subscription
|
// set up our subscription
|
||||||
stream_data.add_sub('devel', sub);
|
stream_data.add_sub('devel', sub);
|
||||||
|
|||||||
@@ -356,8 +356,8 @@ exports.is_current_user = function (email) {
|
|||||||
return email.toLowerCase() === exports.my_current_email().toLowerCase();
|
return email.toLowerCase() === exports.my_current_email().toLowerCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.initialize_current_user = function (email) {
|
exports.initialize_current_user = function (user_id) {
|
||||||
my_user_id = exports.get_user_id(email);
|
my_user_id = user_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.my_current_email = function () {
|
exports.my_current_email = function () {
|
||||||
@@ -387,7 +387,7 @@ $(function () {
|
|||||||
cross_realm_dict.set(person.email, person);
|
cross_realm_dict.set(person.email, person);
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.initialize_current_user(page_params.email);
|
exports.initialize_current_user(page_params.user_id);
|
||||||
|
|
||||||
delete page_params.people_list; // We are the only consumer of this.
|
delete page_params.people_list; // We are the only consumer of this.
|
||||||
delete page_params.cross_realm_bots;
|
delete page_params.cross_realm_bots;
|
||||||
|
|||||||
Reference in New Issue
Block a user