101 lines
3 KiB
TypeScript
101 lines
3 KiB
TypeScript
// Module ID: 11907
|
|
// Function ID: 92195
|
|
// Name: determineEmojiType
|
|
// Dependencies: [11904, 653, 3804, 3713, 11908, 675, 2]
|
|
// Exports: default
|
|
|
|
// Module 11907 (determineEmojiType)
|
|
import { ClearAfterValues } from "StatusTypes";
|
|
import { AnalyticEvents } from "ME";
|
|
|
|
function determineEmojiType(emojiInfo) {
|
|
let tmp = null;
|
|
if (null != emojiInfo) {
|
|
let str = "unicode";
|
|
if (null != emojiInfo.id) {
|
|
str = "custom";
|
|
}
|
|
tmp = str;
|
|
}
|
|
return tmp;
|
|
}
|
|
const result = require("explicitContentFromProto").fileFinishedImporting("modules/custom_status/setCustomStatus.tsx");
|
|
|
|
export default function setCustomStatus(arg0) {
|
|
let _prompt;
|
|
let analyticsContext;
|
|
let analyticsLocations;
|
|
let clearAfter;
|
|
let createdAtMs;
|
|
let emojiInfo;
|
|
let text;
|
|
({ text, emojiInfo, clearAfter, analyticsContext, createdAtMs, prompt: _prompt, analyticsLocations } = arg0);
|
|
const trimmed = text.trim();
|
|
if (trimmed.length <= 0) {
|
|
if (null == emojiInfo) {
|
|
const CustomStatusSetting = require(3804) /* explicitContentFromProto */.CustomStatusSetting;
|
|
return CustomStatusSetting.updateSetting(undefined);
|
|
}
|
|
}
|
|
const CustomStatusSetting2 = require(3804) /* explicitContentFromProto */.CustomStatusSetting;
|
|
let obj = {};
|
|
let str = "";
|
|
if (trimmed.length > 0) {
|
|
str = trimmed;
|
|
}
|
|
obj.text = str;
|
|
let str2 = "0";
|
|
if (null != clearAfter) {
|
|
str2 = "0";
|
|
if (clearAfter !== ClearAfterValues.DONT_CLEAR) {
|
|
const _String = String;
|
|
const obj2 = importDefault(3713)();
|
|
const addResult = importDefault(3713)().add(importDefault(11908)(clearAfter), "ms");
|
|
str2 = String(importDefault(3713)().add(importDefault(11908)(clearAfter), "ms").toDate().getTime());
|
|
const toDateResult = importDefault(3713)().add(importDefault(11908)(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 (null == createdAtMs) {
|
|
const obj5 = importDefault(3713)();
|
|
createdAtMs = importDefault(3713)().toDate().getTime();
|
|
const toDateResult1 = importDefault(3713)().toDate();
|
|
}
|
|
obj.createdAtMs = String(createdAtMs);
|
|
const updateSettingResult = CustomStatusSetting2.updateSetting(obj);
|
|
obj = {};
|
|
let _location = null;
|
|
if (null != analyticsContext) {
|
|
_location = analyticsContext.location;
|
|
}
|
|
obj.location = _location;
|
|
obj.emoji_type = determineEmojiType(emojiInfo);
|
|
obj.text_len = trimmed.length;
|
|
let combined = null;
|
|
if (null != clearAfter) {
|
|
const _HermesInternal = HermesInternal;
|
|
combined = "" + clearAfter;
|
|
}
|
|
obj.clear_after = combined;
|
|
let value;
|
|
if (null != _prompt) {
|
|
value = _prompt.value;
|
|
}
|
|
obj.prompt_type = value;
|
|
obj.location_stack = analyticsLocations;
|
|
importDefault(675).track(AnalyticEvents.CUSTOM_STATUS_UPDATED, obj);
|
|
return updateSettingResult;
|
|
};
|