decord/source/modules/custom_status/utils/userSettingToActivity.tsx

99 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 9498
// Function ID: 9499
2026-07-20 16:05:17 +00:00
// Name: _activityFromSetting
2026-08-13 07:00:46 +00:00
// Dependencies: [19, 5216, 676, 4002, 4034, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: getActivityFromCustomStatus, useCustomStatusActivity
2026-08-13 07:00:46 +00:00
// Module 9498 (_activityFromSetting)
2026-07-29 08:29:29 +00:00
import { useMemo } from "noop";
import getEmojiToGroupId from "getEmojiToGroupId";
2026-07-23 10:11:24 +00:00
import { ActivityTypes } from "ME";
2026-07-20 16:05:17 +00:00
function _activityFromSetting(emojiName) {
if (null != arg1) {
2026-07-29 08:29:29 +00:00
let obj = { id: null, name: null, animated: null };
({ id: obj2[0], name: obj2[1], animated: obj2[2] } = arg1);
2026-07-20 16:05:17 +00:00
let tmp = obj;
} else {
tmp = null;
if (null != emojiName.emojiName) {
tmp = null;
if ("" !== emojiName.emojiName) {
2026-08-12 06:57:52 +00:00
const obj5 = importDefault(4002);
const byName = obj5.getByName(importDefault(4002).convertSurrogateToName(emojiName.emojiName, false));
2026-07-20 16:05:17 +00:00
let tmp2 = null;
if (null != byName) {
2026-07-29 08:29:29 +00:00
obj = { id: null, name: null, animated: false };
obj[1] = byName.surrogates;
2026-07-20 16:05:17 +00:00
tmp2 = obj;
}
tmp = tmp2;
2026-08-12 06:57:52 +00:00
const obj6 = importDefault(4002);
2026-07-20 16:05:17 +00:00
}
}
}
const NumberResult = Number(emojiName.expiresAtMs);
let value;
2026-07-29 08:29:29 +00:00
if (emojiName.label != null) {
2026-07-20 16:05:17 +00:00
value = iter.value;
}
2026-07-29 08:29:29 +00:00
obj = { name: "Custom Status", type: ActivityTypes.CUSTOM_STATUS, state: null, timestamps: null, emoji: null, details: null, metadata: null };
2026-07-20 16:05:17 +00:00
let text;
if (emojiName.text.length > 0) {
text = emojiName.text;
}
2026-07-29 08:29:29 +00:00
obj[2] = text;
2026-07-20 16:05:17 +00:00
let tmp6;
if (NumberResult > 0) {
2026-07-29 08:29:29 +00:00
const obj1 = { end: null };
obj1[0] = NumberResult;
2026-07-20 16:05:17 +00:00
tmp6 = obj1;
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp6;
obj[4] = tmp;
obj[5] = value;
obj[6] = { label: value };
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("modules/custom_status/utils/userSettingToActivity.tsx");
2026-07-20 16:05:17 +00:00
export const getActivityFromCustomStatus = function getActivityFromCustomStatus(setting) {
const emojiId = setting.emojiId;
let usableCustomEmojiById = null;
if (null != emojiId) {
usableCustomEmojiById = null;
if ("0" !== emojiId) {
usableCustomEmojiById = usableCustomEmojiById.getUsableCustomEmojiById(emojiId);
}
}
return _activityFromSetting(setting, usableCustomEmojiById);
};
export const useCustomStatusActivity = function useCustomStatusActivity() {
2026-07-23 10:11:24 +00:00
const CustomStatusSetting = setting(stateFromStores[4]).CustomStatusSetting;
setting = CustomStatusSetting.useSetting();
2026-07-20 16:05:17 +00:00
let emojiId;
2026-07-29 08:29:29 +00:00
if (setting != null) {
2026-07-20 16:05:17 +00:00
emojiId = setting.emojiId;
}
2026-07-29 08:29:29 +00:00
const items = [getEmojiToGroupId];
2026-07-20 16:05:17 +00:00
const items1 = [emojiId];
2026-07-23 10:11:24 +00:00
stateFromStores = setting(stateFromStores[5]).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
let usableCustomEmojiById = null;
if (null != emojiId) {
usableCustomEmojiById = null;
2026-07-29 08:29:29 +00:00
if ("0" !== tmp) {
usableCustomEmojiById = outer1_4.getUsableCustomEmojiById(tmp);
2026-07-20 16:05:17 +00:00
}
}
return usableCustomEmojiById;
}, items1);
const items2 = [setting, stateFromStores];
return useMemo(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != setting) {
2026-07-29 08:29:29 +00:00
tmp2 = outer1_6(tmp, stateFromStores);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items2);
};