decord/source/modules/user_profile/hooks/useUserProfileActivityTabContent.tsx
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

124 lines
4.3 KiB
TypeScript

// Module ID: 13197
// Function ID: 13198
// Name: useUserProfileActivityTabContent
// Dependencies: [19, 8918, 4676, 5360, 4655, 7723, 1074, 3, 13198, 13171, 13173, 8459, 504, 2]
// Exports: default
// Module 13197 (useUserProfileActivityTabContent)
import LoggerDefault from "Logger" /* 3 */;
import ContentInventoryTypes from "ContentInventoryTypes" /* 8459 */;
import maybeFetchContentInventoryOutboxDefault from "maybeFetchContentInventoryOutbox" /* 13198 */;
import noop from "module_19" /* 19 */;
import ContentInventoryOutboxStore from "ContentInventoryOutboxStore" /* 8918 */;
import PresenceStore from "PresenceStore" /* 4676 */;
import SelfPresenceStore from "SelfPresenceStore" /* 5360 */;
import VoiceStateStore from "VoiceStateStore" /* 4655 */;
import UserProfileStore from "UserProfileStore" /* 7723 */;
require = fn;
const StatusTypes = fn(1074).StatusTypes;
let closure_10 = new LoggerDefault("useUserProfileActivityTabContent");
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/hooks/useUserProfileActivityTabContent.tsx");
export default function useUserProfileActivityTabContent(userId) {
userId = userId.userId;
recent = undefined;
let voiceChannel;
let voiceActivity;
closure_4 = undefined;
const items = [userId];
({ currentUserId, guildId } = userId);
const effect = voiceActivity.useEffect(() => {
const promise = maybeFetchContentInventoryOutboxDefault(userId);
if (promise != null) {
promise.catch((error) => {
logger.log("Failed to fetch content inventory outbox for " + userId + ":", error);
});
}
}, items);
const tmp2 = recent(voiceChannel[9])(userId);
({ live, recent } = tmp2);
const stream = tmp2.stream;
const tmp3 = recent(voiceChannel[10])({ userId, guildId });
voiceChannel = tmp3.voiceChannel;
voiceActivity = tmp3.voiceActivity;
const items1 = [recent];
const memo = voiceActivity.useMemo(() => recent.filter(ContentInventoryTypes.isRecentActivityEntry), items1);
const items2 = [closure_4];
closure_4 = tmp5;
const stateFromStores = userId(voiceChannel[12]).useStateFromStores(items2, () => ContentInventoryOutboxStore.isFetchingUserOutbox(userId));
const obj = userId(voiceChannel[12]);
const items3 = [SelfPresenceStore, PresenceStore];
const stateFromStores1 = userId(voiceChannel[12]).useStateFromStores(items3, () => {
if (closure_4) {
let status = SelfPresenceStore.getStatus();
} else {
status = PresenceStore.getStatus(userId);
}
return status === StatusTypes.OFFLINE || status === StatusTypes.INVISIBLE;
});
const obj2 = userId(voiceChannel[12]);
const items4 = [UserProfileStore];
const stateFromStores2 = userId(voiceChannel[12]).useStateFromStores(items4, () => {
const userProfile = UserProfileStore.getUserProfile(userId);
let _private;
if (userProfile != null) {
_private = userProfile.private;
}
return true === _private;
});
const obj3 = userId(voiceChannel[12]);
const items5 = [VoiceStateStore];
let found = live;
const stateFromStores3 = userId(voiceChannel[12]).useStateFromStores(items5, () => {
let isInChannelResult = null != voiceChannel;
if (isInChannelResult) {
isInChannelResult = VoiceStateStore.isInChannel(tmp.id);
}
return isInChannelResult;
});
if (null != voiceActivity) {
found = live.filter((item) => item !== voiceActivity);
}
let tmp9 = stateFromStores1;
if (!stateFromStores1) {
tmp9 = stateFromStores2;
}
if (tmp9) {
tmp9 = null != voiceChannel;
}
if (tmp9) {
tmp9 = stateFromStores3;
}
let tmp10 = !tmp9;
if (!tmp9) {
tmp10 = !stateFromStores1;
}
if (tmp10) {
let tmp11 = found.length > 0;
if (!tmp11) {
let tmp12 = !stateFromStores2;
if (!stateFromStores2) {
tmp12 = null != voiceChannel;
}
tmp11 = tmp12;
}
if (!tmp11) {
let tmp13 = !stateFromStores2;
if (!stateFromStores2) {
tmp13 = null != stream;
}
if (tmp13) {
let id;
if (voiceChannel != null) {
id = voiceChannel.id;
}
tmp13 = stream.channelId !== id;
}
tmp11 = tmp13;
}
tmp10 = tmp11;
}
return { recent: memo, isFetching: stateFromStores, isCurrentUser: userId === currentUserId, hasCurrentActivity: tmp10, hasRecentActivity: memo.length > 0 };
};