decord/beta/source/modules/app_analytics/ThreadAnalyticsUtils.tsx

67 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 7402
// Function ID: 7403
// Name: ThreadAnalyticsUtils
2026-10-07 22:43:51 +00:00
// Dependencies: [7266, 6809, 2055, 4509, 1085, 1112, 11, 2]
// Exports: collectThreadMetadata
2026-10-07 22:43:51 +00:00
// Module 7402 (ThreadAnalyticsUtils)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
2026-10-07 22:43:51 +00:00
import Constants from "Constants" /* 1085 */;
import router_utils from "router_utils" /* 1112 */;
2026-10-02 13:37:24 +00:00
import ChannelRecord from "ChannelRecord" /* 2055 */;
2026-10-07 22:43:51 +00:00
import ThreadMembersStore from "ThreadMembersStore" /* 7266 */;
import ThreadMessageStore from "ThreadMessageStore" /* 6809 */;
import PermissionStore from "PermissionStore" /* 4509 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
const THREAD_CHANNEL_TYPES = ChannelRecord.THREAD_CHANNEL_TYPES;
const Permissions = Constants.Permissions;
const result = size.fileFinishedImporting("modules/app_analytics/ThreadAnalyticsUtils.tsx");
export const collectThreadMetadata = function collectThreadMetadata(channel, arg1) {
2026-10-01 14:13:23 +00:00
let archived;
let flag3;
let num;
let obj3;
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
let tmp = null;
if (null != channel) {
tmp = null;
if (THREAD_CHANNEL_TYPES.has(channel.type)) {
let lastRouteChangeSource;
if (flag) {
2026-10-01 14:13:23 +00:00
const obj = router_utils;
lastRouteChangeSource = obj.getLastRouteChangeSource();
}
const threadMetadata = channel.threadMetadata;
2026-10-01 14:13:23 +00:00
const obj2 = { location: lastRouteChangeSource, thread_approximate_member_count: ThreadMembersStore.getMemberCount(channel.id), thread_approximate_message_count: ThreadMessageStore.getCount(channel.id), thread_archived: true === archived, thread_locked: flag3, thread_auto_archive_duration_minutes: num, thread_approximate_creation_date: obj3.extractTimestamp(channel.id), can_send_message: PermissionStore.can(Permissions.SEND_MESSAGES, channel), parent_channel_type: channel.parentChannelThreadType };
archived = undefined;
if (threadMetadata != null) {
archived = threadMetadata.archived;
}
const threadMetadata2 = channel.threadMetadata;
2026-10-01 14:13:23 +00:00
flag3 = undefined;
if (threadMetadata2 != null) {
flag3 = threadMetadata2.locked;
}
if (flag3 == null) {
flag3 = false;
}
const threadMetadata3 = channel.threadMetadata;
2026-10-01 14:13:23 +00:00
num = undefined;
if (threadMetadata3 != null) {
num = threadMetadata3.autoArchiveDuration;
}
if (num == null) {
num = 0;
}
tmp = obj2;
2026-10-01 14:13:23 +00:00
obj3 = SnowflakeUtilsDefault;
}
}
return tmp;
};