presence: Rename presence.set_user_status() -> set_info_for_user().

This commit is contained in:
Steve Howell 2018-12-18 17:30:40 +00:00 committed by Tim Abbott
parent ba69dcc74c
commit f4f59a7557
4 changed files with 9 additions and 9 deletions

View File

@ -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);
});
}

View File

@ -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);

View File

@ -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();
};

View File

@ -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;
};