decord/alpha/source/modules/friends/getFriendStatusCounts.tsx

36 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 17236
// Function ID: 17237
2026-07-29 08:29:29 +00:00
// Name: getFriendStatusCounts
2026-10-08 09:57:35 +00:00
// Dependencies: [5106, 4717, 1085, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-08 09:57:35 +00:00
// Module 17236 (getFriendStatusCounts)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-08 09:57:35 +00:00
import PresenceStore from "PresenceStore" /* 5106 */;
import RelationshipStore from "RelationshipStore" /* 4717 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const StatusTypes = Constants.StatusTypes;
const result = size.fileFinishedImporting("modules/friends/getFriendStatusCounts.tsx");
2026-07-20 16:05:17 +00:00
export default function getFriendStatusCounts() {
2026-07-29 08:29:29 +00:00
let num_friends_online = 0;
let num_friends_idle = 0;
let num_friends_dnd = 0;
const friendIDs = RelationshipStore.getFriendIDs();
2026-10-03 08:58:59 +00:00
const tmp2 = friendIDs[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
while (tmp2 !== undefined) {
let status = PresenceStore.getStatus(tmp3);
2026-07-29 08:29:29 +00:00
let tmp6 = StatusTypes;
if (StatusTypes.ONLINE === status) {
num_friends_online = num_friends_online + 1;
} else if (tmp6.IDLE === status) {
num_friends_idle = num_friends_idle + 1;
} else if (tmp6.DND === status) {
num_friends_dnd = num_friends_dnd + 1;
}
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return { num_friends_online, num_friends_idle, num_friends_dnd };
2026-07-20 16:05:17 +00:00
};