Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
126 lines
4.6 KiB
TypeScript
126 lines
4.6 KiB
TypeScript
// Module ID: 13423
|
|
// Function ID: 13424
|
|
// Name: useActivityStatusLabel
|
|
// Dependencies: [4662, 1958, 4278, 4680, 4288, 4659, 1074, 504, 11034, 11032, 11033, 11040, 1115, 11042, 11047, 2]
|
|
// Exports: default
|
|
|
|
// Module 13423 (useActivityStatusLabel)
|
|
import useDiscoverableApplicationStream from "useDiscoverableApplicationStream" /* 11032 */;
|
|
import useUserVoiceActivity from "useUserVoiceActivity" /* 11033 */;
|
|
import isGameActivityDefault from "isGameActivity" /* 11040 */;
|
|
import getActivityStatusTextDefault from "getActivityStatusText" /* 11042 */;
|
|
import ApplicationStreamingStore from "ApplicationStreamingStore" /* 4662 */;
|
|
import ChannelStore from "ChannelStore" /* 1958 */;
|
|
import PermissionStore from "PermissionStore" /* 4278 */;
|
|
import PresenceStore from "PresenceStore" /* 4680 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4288 */;
|
|
import VoiceStateStore from "VoiceStateStore" /* 4659 */;
|
|
|
|
const util = v0wJXSh(1115);
|
|
const VoiceActivityStatus = v0wJXSh(11047);
|
|
require = fn;
|
|
const ActivityTypes = fn(1074).ActivityTypes;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/activity_status/native/useActivityStatusLabel.tsx");
|
|
|
|
export default function useActivityStatusLabel(userId) {
|
|
userId = userId.userId;
|
|
const guildId = userId.guildId;
|
|
let gameMentionsAsPlainText;
|
|
let items = [PresenceStore];
|
|
let items1 = [userId];
|
|
const stateFromStores = userId(gameMentionsAsPlainText[7]).useStateFromStores(items, () => {
|
|
if (null == userId) {
|
|
return null;
|
|
} else {
|
|
const activities = PresenceStore.getActivities(tmp);
|
|
let state;
|
|
if (activities != null) {
|
|
const found = activities.find((type) => type.type === constants.CUSTOM_STATUS);
|
|
if (found != null) {
|
|
state = found.state;
|
|
}
|
|
}
|
|
let tmp5 = null;
|
|
if (null != state) {
|
|
tmp5 = null;
|
|
if ("" !== state.trim()) {
|
|
tmp5 = state;
|
|
}
|
|
}
|
|
return tmp5;
|
|
}
|
|
}, items1);
|
|
let obj = userId(gameMentionsAsPlainText[7]);
|
|
gameMentionsAsPlainText = userId(gameMentionsAsPlainText[8]).useGameMentionsAsPlainText(stateFromStores);
|
|
let obj2 = userId(gameMentionsAsPlainText[8]);
|
|
const items2 = [PresenceStore, ApplicationStreamingStore, RelationshipStore, ChannelStore, PermissionStore, VoiceStateStore];
|
|
const items3 = [userId, guildId, gameMentionsAsPlainText];
|
|
return userId(gameMentionsAsPlainText[7]).useStateFromStores(items2, () => {
|
|
if (null != userId) {
|
|
if (RelationshipStore.isBlockedOrIgnored(tmp)) {
|
|
return null;
|
|
}
|
|
}
|
|
if (null != userId) {
|
|
const activities = PresenceStore.getActivities(tmp);
|
|
}
|
|
let v0wJXSh = require;
|
|
let obj = dependencyMap;
|
|
const items = [ApplicationStreamingStore, RelationshipStore];
|
|
const discoverableApplicationStream = useDiscoverableApplicationStream.getDiscoverableApplicationStream(tmp, items);
|
|
const voiceChannel = useUserVoiceActivity.getVisibleUserVoiceActivity({ userId, guildId }, { ChannelStore, PermissionStore, VoiceStateStore }).voiceChannel;
|
|
if (null != discoverableApplicationStream) {
|
|
let name;
|
|
if (activities != null) {
|
|
const found = activities.find(isGameActivityDefault);
|
|
if (found != null) {
|
|
name = found.name;
|
|
}
|
|
}
|
|
if (null == name) {
|
|
const intl = util.intl;
|
|
let stringResult = intl.string(util.t.eXan7B);
|
|
}
|
|
const intl2 = util.intl;
|
|
v0wJXSh = util.t["0wJXSh"];
|
|
obj = { name };
|
|
stringResult = intl2.formatToPlainString(v0wJXSh, obj);
|
|
} else {
|
|
let found1;
|
|
if (activities != null) {
|
|
found1 = activities.find((type) => {
|
|
type = type.type;
|
|
return type !== constants.CUSTOM_STATUS && type !== constants.HANG_STATUS;
|
|
});
|
|
}
|
|
if (null != found1) {
|
|
let text = getActivityStatusTextDefault(found1, true).text;
|
|
if (text == null) {
|
|
text = null;
|
|
}
|
|
let voiceActivityStatusText = text;
|
|
} else {
|
|
voiceActivityStatusText = null;
|
|
if (null != voiceChannel) {
|
|
voiceActivityStatusText = VoiceActivityStatus.getVoiceActivityStatusText(voiceChannel);
|
|
const v0wJXShResult = VoiceActivityStatus;
|
|
}
|
|
}
|
|
const items1 = [voiceActivityStatusText, gameMentionsAsPlainText];
|
|
const found2 = items1.filter((item) => {
|
|
let tmp = null != item;
|
|
if (tmp) {
|
|
tmp = "" !== item;
|
|
}
|
|
return tmp;
|
|
});
|
|
const joined = found2.join(", ");
|
|
let tmp17 = null;
|
|
if ("" !== joined) {
|
|
tmp17 = joined;
|
|
}
|
|
return tmp17;
|
|
}
|
|
}, items3);
|
|
};
|