Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
131 lines
4.8 KiB
TypeScript
131 lines
4.8 KiB
TypeScript
// Module ID: 17938
|
|
// Function ID: 17939
|
|
// Name: BaseActionInfo
|
|
// Dependencies: [2041, 4405, 1372, 12115, 2107, 1115, 4909, 2]
|
|
// Exports: getBaseActionInfo
|
|
|
|
// Module 17938 (BaseActionInfo)
|
|
import util from "util" /* 1115 */;
|
|
import useChannelName from "useChannelName" /* 4909 */;
|
|
import ChannelStore from "ChannelStore" /* 2041 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4405 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
require = fn;
|
|
const Constants = fn(12115);
|
|
({ AutomodActionType: hasOwnProperty, AutomodTriggerType: metroRequire } = Constants);
|
|
const getFriendlyDurationString = fn(2107).getFriendlyDurationString;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_automod/BaseActionInfo.tsx");
|
|
|
|
export const getBaseActionInfo = function getBaseActionInfo(actionType, metadata, triggerType) {
|
|
if (constants.BLOCK_MESSAGE !== actionType) {
|
|
if (tmp.FLAG_TO_CHANNEL !== actionType) {
|
|
if (tmp.USER_COMMUNICATION_DISABLED !== actionType) {
|
|
let flag = false;
|
|
}
|
|
let tmp3 = null;
|
|
if (flag) {
|
|
if (tmp.BLOCK_MESSAGE === actionType) {
|
|
const intl3 = util.intl;
|
|
let str = intl3.string(util.t.d1ab8n);
|
|
} else if (tmp.FLAG_TO_CHANNEL === actionType) {
|
|
const intl2 = util.intl;
|
|
str = intl2.string(util.t["Y+VmvU"]);
|
|
} else if (tmp.USER_COMMUNICATION_DISABLED === actionType) {
|
|
const intl = util.intl;
|
|
str = intl.string(util.t.Xz2njA);
|
|
} else if (tmp.QUARANTINE_USER === actionType) {
|
|
const intl11 = util.intl;
|
|
str = intl11.string(util.t.NPO8ee);
|
|
}
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
let KEYWORD = triggerType;
|
|
const obj = { headerText: str, descriptionText: null, helperText: null, isEditable: null };
|
|
if (triggerType === undefined) {
|
|
KEYWORD = constants2.KEYWORD;
|
|
}
|
|
if (tmp.BLOCK_MESSAGE === actionType) {
|
|
if (constants2.MENTION_SPAM === KEYWORD) {
|
|
const intl8 = util.intl;
|
|
let str2 = intl8.string(util.t["8hdId3"]);
|
|
} else if (tmp15.ML_SPAM === KEYWORD) {
|
|
const intl7 = util.intl;
|
|
str2 = intl7.string(util.t.tLQYs5);
|
|
} else {
|
|
const intl6 = util.intl;
|
|
str2 = intl6.string(util.t.xAAoci);
|
|
}
|
|
} else if (tmp.FLAG_TO_CHANNEL === actionType) {
|
|
const intl5 = util.intl;
|
|
str2 = intl5.string(util.t.BHAXfa);
|
|
} else if (tmp.USER_COMMUNICATION_DISABLED === actionType) {
|
|
const intl4 = util.intl;
|
|
str2 = intl4.string(util.t["bNK+gI"]);
|
|
} else if (tmp.QUARANTINE_USER === actionType) {
|
|
const intl12 = util.intl;
|
|
str2 = intl12.string(util.t["/7nL5R"]);
|
|
}
|
|
if (str2 == null) {
|
|
str2 = "";
|
|
}
|
|
obj.descriptionText = str2;
|
|
let formatResult = null;
|
|
if (tmp.QUARANTINE_USER !== actionType) {
|
|
formatResult = null;
|
|
if (tmp.BLOCK_MESSAGE !== actionType) {
|
|
if (tmp.FLAG_TO_CHANNEL === actionType) {
|
|
let channelId;
|
|
if (metadata != null) {
|
|
const metadata2 = metadata.metadata;
|
|
if (metadata2 != null) {
|
|
channelId = metadata2.channelId;
|
|
}
|
|
}
|
|
formatResult = null;
|
|
if (null != channelId) {
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
formatResult = null;
|
|
if (null != channel) {
|
|
const channelName = useChannelName.computeChannelName(channel, UserStore, RelationshipStore);
|
|
const intl10 = util.intl;
|
|
const obj2 = { channelName };
|
|
formatResult = intl10.format(util.t.xQXnkK, obj2);
|
|
}
|
|
}
|
|
} else if (tmp.USER_COMMUNICATION_DISABLED === actionType) {
|
|
let num;
|
|
if (metadata != null) {
|
|
metadata = metadata.metadata;
|
|
if (metadata != null) {
|
|
num = metadata.durationSeconds;
|
|
}
|
|
}
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
const tmp40Result = getFriendlyDurationString(num);
|
|
let formatResult1 = null;
|
|
if (null != tmp40Result) {
|
|
const intl9 = util.intl;
|
|
const obj4 = { duration: tmp40Result };
|
|
formatResult1 = intl9.format(util.t.AFmbfS, obj4);
|
|
}
|
|
formatResult = formatResult1;
|
|
}
|
|
}
|
|
}
|
|
if (formatResult == null) {
|
|
formatResult = null;
|
|
}
|
|
obj.helperText = formatResult;
|
|
obj.isEditable = actionType !== tmp.QUARANTINE_USER;
|
|
tmp3 = obj;
|
|
}
|
|
return tmp3;
|
|
}
|
|
}
|
|
flag = true;
|
|
};
|