mirror of https://github.com/zulip/zulip.git
IntDict: Use IntDict for user_info in user_status.
This commit is contained in:
parent
30ee0c2a49
commit
d8554e085c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue