decord/alpha/source/modules/custom_status/setCustomStatus.tsx

107 lines
3.2 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 10522
// Function ID: 10523
2026-07-29 08:29:29 +00:00
// Name: setCustomStatus
2026-10-12 06:59:38 +00:00
// Dependencies: [10519, 1085, 2041, 4702, 10523, 1265, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-12 06:59:38 +00:00
// Module 10522 (setCustomStatus)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
import UserSettings from "UserSettings" /* 2041 */;
2026-10-10 08:08:14 +00:00
import _modDef4702 from "module_4702" /* 4702 */;
2026-10-12 06:59:38 +00:00
import Constants2 from "Constants" /* 10519 */;
import getClearAfterDurationDefault from "getClearAfterDuration" /* 10523 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const ClearAfterValues = Constants2.ClearAfterValues;
const AnalyticEvents = Constants.AnalyticEvents;
const result = size.fileFinishedImporting("modules/custom_status/setCustomStatus.tsx");
2026-07-20 16:05:17 +00:00
export default function setCustomStatus(arg0) {
2026-10-03 08:58:59 +00:00
let _String2;
let _prompt;
let analyticsContext;
let analyticsLocations;
let clearAfter;
let combined;
let createdAtMs;
let emojiInfo;
let str2;
let str4;
let str5;
let text;
let tmp12;
let value;
2026-07-20 16:05:17 +00:00
({ text, emojiInfo, clearAfter, analyticsContext, createdAtMs, prompt: _prompt, analyticsLocations } = arg0);
const trimmed = text.trim();
if (trimmed.length <= 0) {
if (null == emojiInfo) {
const CustomStatusSetting = UserSettings.CustomStatusSetting;
2026-07-20 16:05:17 +00:00
return CustomStatusSetting.updateSetting(undefined);
}
}
const CustomStatusSetting2 = UserSettings.CustomStatusSetting;
2026-07-20 16:05:17 +00:00
let str = "";
2026-10-03 08:58:59 +00:00
const updateSetting = CustomStatusSetting2.updateSetting;
2026-07-20 16:05:17 +00:00
if (trimmed.length > 0) {
str = trimmed;
}
2026-10-03 08:58:59 +00:00
const obj = { text: str, expiresAtMs: str2, emojiId: str4, emojiName: str5, createdAtMs: _String2(createdAtMs) };
str2 = "0";
2026-07-20 16:05:17 +00:00
if (null != clearAfter) {
str2 = "0";
if (clearAfter !== ClearAfterValues.DONT_CLEAR) {
const _String = String;
2026-10-10 08:08:14 +00:00
const obj2 = _modDef4702();
2026-10-03 08:58:59 +00:00
const addResult = obj2.add(getClearAfterDurationDefault(clearAfter), "ms");
const toDateResult = addResult.toDate();
str2 = String(toDateResult.getTime());
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
str4 = "0";
2026-07-20 16:05:17 +00:00
if (null != emojiInfo) {
str4 = "0";
if (null != emojiInfo.id) {
str4 = emojiInfo.id;
}
}
2026-10-03 08:58:59 +00:00
str5 = "";
2026-07-20 16:05:17 +00:00
if (null != emojiInfo) {
str5 = emojiInfo.name;
}
2026-10-03 08:58:59 +00:00
_String2 = String;
2026-07-29 08:29:29 +00:00
if (createdAtMs == null) {
2026-10-10 08:08:14 +00:00
const obj5 = _modDef4702();
2026-10-03 08:58:59 +00:00
const toDateResult1 = obj5.toDate();
createdAtMs = toDateResult1.getTime();
2026-07-20 16:05:17 +00:00
}
let _location = null;
2026-10-03 08:58:59 +00:00
const updateSettingResult = updateSetting(obj);
const track = AnalyticsUtilsDefault.track;
const CUSTOM_STATUS_UPDATED = AnalyticEvents.CUSTOM_STATUS_UPDATED;
AnalyticsUtilsDefault;
2026-07-20 16:05:17 +00:00
if (null != analyticsContext) {
_location = analyticsContext.location;
}
2026-10-03 08:58:59 +00:00
const obj3 = { location: _location, emoji_type: tmp12, text_len: trimmed.length, clear_after: combined, prompt_type: value, location_stack: analyticsLocations };
tmp12 = null;
2026-07-29 08:29:29 +00:00
if (null != emojiInfo) {
let str6 = "unicode";
if (null != emojiInfo.id) {
str6 = "custom";
}
2026-10-03 08:58:59 +00:00
tmp12 = str6;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
combined = null;
2026-07-20 16:05:17 +00:00
if (null != clearAfter) {
const _HermesInternal = HermesInternal;
combined = "" + clearAfter;
}
value = undefined;
2026-07-29 08:29:29 +00:00
if (_prompt != null) {
2026-07-20 16:05:17 +00:00
value = _prompt.value;
}
2026-10-03 08:58:59 +00:00
track(CUSTOM_STATUS_UPDATED, obj3);
2026-07-20 16:05:17 +00:00
return updateSettingResult;
};