IntDict: Use IntDict for user_info in user_status.

This commit is contained in:
Steve Howell 2020-01-12 21:09:39 +00:00
parent 30ee0c2a49
commit d8554e085c
1 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,8 @@
const Dict = require('./dict').Dict;
const IntDict = require('./int_dict').IntDict;
const away_user_ids = new Dict();
const user_info = new Dict();
const user_info = new IntDict();
exports.server_update = function (opts) {
channel.post({
@ -53,7 +54,11 @@ exports.set_status_text = function (opts) {
};
exports.initialize = function () {
_.each(page_params.user_status, function (dct, user_id) {
_.each(page_params.user_status, function (dct, str_user_id) {
// JSON does not allow integer keys, so we
// convert them here.
const user_id = parseInt(str_user_id, 10);
if (dct.away) {
away_user_ids.set(user_id, true);
}