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

98 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 8283
// Function ID: 65283
2026-07-20 16:05:17 +00:00
// Name: _activityFromSetting
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 4991, 653, 3771, 3803, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: getActivityFromCustomStatus, useCustomStatusActivity
2026-07-24 07:16:23 +00:00
// Module 8283 (_activityFromSetting)
2026-07-23 10:11:24 +00:00
import { useMemo } from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { ActivityTypes } from "ME";
2026-07-20 16:05:17 +00:00
function _activityFromSetting(emojiName) {
if (null != arg1) {
let obj = {};
({ id: obj2.id, name: obj2.name, animated: obj2.animated } = arg1);
let tmp = obj;
} else {
tmp = null;
if (null != emojiName.emojiName) {
tmp = null;
if ("" !== emojiName.emojiName) {
2026-07-23 10:11:24 +00:00
const obj6 = importDefault(3771);
const byName = obj6.getByName(importDefault(3771).convertSurrogateToName(emojiName.emojiName, false));
2026-07-20 16:05:17 +00:00
let tmp2 = null;
if (null != byName) {
2026-07-23 10:11:24 +00:00
obj = { id: null, name: byName.surrogates, animated: false };
2026-07-20 16:05:17 +00:00
tmp2 = obj;
}
tmp = tmp2;
2026-07-23 10:11:24 +00:00
const obj7 = importDefault(3771);
2026-07-20 16:05:17 +00:00
}
}
}
const NumberResult = Number(emojiName.expiresAtMs);
let value;
if (null != emojiName.label) {
value = iter.value;
}
obj = { name: "Custom Status", type: ActivityTypes.CUSTOM_STATUS };
let text;
if (emojiName.text.length > 0) {
text = emojiName.text;
}
obj.state = text;
let tmp6;
if (NumberResult > 0) {
const obj1 = { end: NumberResult };
tmp6 = obj1;
}
obj.timestamps = tmp6;
obj.emoji = tmp;
obj.details = value;
const obj2 = { label: value };
obj.metadata = obj2;
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;
if (null != setting) {
emojiId = setting.emojiId;
}
2026-07-23 10:11:24 +00:00
const items = [_isNativeReflectConstruct];
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;
if ("0" !== emojiId) {
2026-07-23 10:11:24 +00:00
usableCustomEmojiById = outer1_4.getUsableCustomEmojiById(emojiId);
2026-07-20 16:05:17 +00:00
}
}
return usableCustomEmojiById;
}, items1);
const items2 = [setting, stateFromStores];
return useMemo(() => {
let tmp = null;
if (null != setting) {
2026-07-23 10:11:24 +00:00
tmp = outer1_6(setting, stateFromStores);
2026-07-20 16:05:17 +00:00
}
return tmp;
}, items2);
};