Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
96 lines
3.2 KiB
TypeScript
96 lines
3.2 KiB
TypeScript
// Module ID: 11256
|
|
// Function ID: 11257
|
|
// Name: setCustomStatus
|
|
// Dependencies: [11253, 1074, 1935, 4228, 11257, 1240, 2]
|
|
// Exports: default
|
|
|
|
// Module 11256 (setCustomStatus)
|
|
import Constants from "Constants" /* 1074 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */;
|
|
import UserSettings from "UserSettings" /* 1935 */;
|
|
import _modDef4228 from "module_4228" /* 4228 */;
|
|
import Constants2 from "Constants" /* 11253 */;
|
|
import getClearAfterDurationDefault from "getClearAfterDuration" /* 11257 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const ClearAfterValues = Constants2.ClearAfterValues;
|
|
const AnalyticEvents = Constants.AnalyticEvents;
|
|
const result = size.fileFinishedImporting("modules/custom_status/setCustomStatus.tsx");
|
|
|
|
export default function setCustomStatus(arg0) {
|
|
({ text, emojiInfo, clearAfter, analyticsContext, createdAtMs, prompt: _prompt, analyticsLocations } = arg0);
|
|
const trimmed = text.trim();
|
|
if (trimmed.length <= 0) {
|
|
if (null == emojiInfo) {
|
|
const CustomStatusSetting = UserSettings.CustomStatusSetting;
|
|
return CustomStatusSetting.updateSetting(undefined);
|
|
}
|
|
}
|
|
const CustomStatusSetting2 = UserSettings.CustomStatusSetting;
|
|
let str = "";
|
|
if (trimmed.length > 0) {
|
|
str = trimmed;
|
|
}
|
|
const obj = { text: str, expiresAtMs: null, emojiId: null, emojiName: null, createdAtMs: null };
|
|
let str2 = "0";
|
|
if (null != clearAfter) {
|
|
str2 = "0";
|
|
if (clearAfter !== ClearAfterValues.DONT_CLEAR) {
|
|
const _String = String;
|
|
const obj2 = _modDef4228();
|
|
const addResult = _modDef4228().add(getClearAfterDurationDefault(clearAfter), "ms");
|
|
str2 = String(_modDef4228().add(getClearAfterDurationDefault(clearAfter), "ms").toDate().getTime());
|
|
const toDateResult = _modDef4228().add(getClearAfterDurationDefault(clearAfter), "ms").toDate();
|
|
}
|
|
}
|
|
obj.expiresAtMs = str2;
|
|
let str4 = "0";
|
|
if (null != emojiInfo) {
|
|
str4 = "0";
|
|
if (null != emojiInfo.id) {
|
|
str4 = emojiInfo.id;
|
|
}
|
|
}
|
|
obj.emojiId = str4;
|
|
let str5 = "";
|
|
if (null != emojiInfo) {
|
|
str5 = emojiInfo.name;
|
|
}
|
|
obj.emojiName = str5;
|
|
if (createdAtMs == null) {
|
|
const obj5 = _modDef4228();
|
|
createdAtMs = _modDef4228().toDate().getTime();
|
|
const toDateResult1 = _modDef4228().toDate();
|
|
}
|
|
obj.createdAtMs = String(createdAtMs);
|
|
const updateSettingResult = CustomStatusSetting2.updateSetting(obj);
|
|
let _location = null;
|
|
if (null != analyticsContext) {
|
|
_location = analyticsContext.location;
|
|
}
|
|
const obj3 = { location: _location, emoji_type: null, text_len: null, clear_after: null, prompt_type: null, location_stack: null };
|
|
let tmp11 = null;
|
|
if (null != emojiInfo) {
|
|
let str6 = "unicode";
|
|
if (null != emojiInfo.id) {
|
|
str6 = "custom";
|
|
}
|
|
tmp11 = str6;
|
|
}
|
|
obj3.emoji_type = tmp11;
|
|
obj3.text_len = trimmed.length;
|
|
let combined = null;
|
|
if (null != clearAfter) {
|
|
const _HermesInternal = HermesInternal;
|
|
combined = "" + clearAfter;
|
|
}
|
|
obj3.clear_after = combined;
|
|
value = undefined;
|
|
if (_prompt != null) {
|
|
value = _prompt.value;
|
|
}
|
|
obj3.prompt_type = value;
|
|
obj3.location_stack = analyticsLocations;
|
|
AnalyticsUtilsDefault.track(AnalyticEvents.CUSTOM_STATUS_UPDATED, obj3);
|
|
return updateSettingResult;
|
|
};
|