mirror of https://github.com/zulip/zulip.git
presence: Rename presence.set_user_status() -> set_info_for_user().
This commit is contained in:
parent
ba69dcc74c
commit
f4f59a7557
|
@ -57,17 +57,17 @@ function activate_people() {
|
|||
};
|
||||
|
||||
// Make 400 of the users active
|
||||
presence.set_user_status(selma.user_id, info, server_time);
|
||||
presence.set_user_status(me.user_id, info, server_time);
|
||||
presence.set_info_for_user(selma.user_id, info, server_time);
|
||||
presence.set_info_for_user(me.user_id, info, server_time);
|
||||
|
||||
_.each(_.range(1002, 1400), (user_id) => {
|
||||
presence.set_user_status(user_id, info, server_time);
|
||||
_.each(_.range(1000, 1400), (user_id) => {
|
||||
presence.set_info_for_user(user_id, info, server_time);
|
||||
});
|
||||
|
||||
|
||||
// And then 300 not active
|
||||
_.each(_.range(1400, 1700), (user_id) => {
|
||||
presence.set_user_status(user_id, {}, server_time);
|
||||
presence.set_info_for_user(user_id, {}, server_time);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ run_test('last_active_date', () => {
|
|||
assert.deepEqual(presence.last_active_date(alice.user_id), {seconds: 500000});
|
||||
});
|
||||
|
||||
run_test('set_user_status', () => {
|
||||
run_test('set_info_for_user', () => {
|
||||
var server_time = 500;
|
||||
var info = {
|
||||
website: {
|
||||
|
@ -231,7 +231,7 @@ run_test('set_user_status', () => {
|
|||
};
|
||||
|
||||
presence.presence_info[alice.user_id] = undefined;
|
||||
presence.set_user_status(alice.user_id, info, server_time);
|
||||
presence.set_info_for_user(alice.user_id, info, server_time);
|
||||
|
||||
var expected = { status: 'active', mobile: false, last_active: 500 };
|
||||
assert.deepEqual(presence.presence_info[alice.user_id], expected);
|
||||
|
|
|
@ -387,7 +387,7 @@ exports.update_presence_info = function (email, info, server_time) {
|
|||
return;
|
||||
}
|
||||
|
||||
presence.set_user_status(user_id, info, server_time);
|
||||
presence.set_info_for_user(user_id, info, server_time);
|
||||
exports.insert_user_into_list(user_id);
|
||||
exports.update_huddles();
|
||||
};
|
||||
|
|
|
@ -93,7 +93,7 @@ function status_from_timestamp(baseline_time, info) {
|
|||
// For testing
|
||||
exports._status_from_timestamp = status_from_timestamp;
|
||||
|
||||
exports.set_user_status = function (user_id, info, server_time) {
|
||||
exports.set_info_for_user = function (user_id, info, server_time) {
|
||||
var status = status_from_timestamp(server_time, info);
|
||||
exports.presence_info[user_id] = status;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue