decord/source/modules/self_mod/ChannelSafetyWarningsManager.tsx

99 lines
3.7 KiB
TypeScript
Raw Normal View History

// Module ID: 17331
// Function ID: 17332
2026-07-29 08:29:29 +00:00
// Name: handleChannelSelect
// Dependencies: [1957, 2011, 10968, 11397, 17332, 7118, 2]
2026-07-20 16:05:17 +00:00
// Module 17331 (handleChannelSelect)
import initializeDefault from "initialize" /* 7118 */;
import InappropriateConversationExperiment from "InappropriateConversationExperiment" /* 10968 */;
import closure_2 from "ensureGuildLoaded" /* 1957 */;
import closure_3 from "handleConnectionOpen" /* 2011 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function handleChannelSelect(channelId) {
channelId = channelId.channelId;
if (null == channelId) {
return false;
} else {
2026-07-29 08:29:29 +00:00
if (obj6.isEligibleForInappropriateConversationWarning({ location: "channel_select" })) {
let tmp4Result = tmp4(11397);
2026-07-29 08:29:29 +00:00
if (tmp4Result.getSafetyAlertsSettingOrDefault()) {
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (channel.isDM()) {
tmp4Result = tmp4(11397);
2026-07-29 08:29:29 +00:00
const inappropriateConversationTakeoverForChannel = tmp4Result.getInappropriateConversationTakeoverForChannel(channelId);
2026-07-20 16:05:17 +00:00
let flag3 = null != inappropriateConversationTakeoverForChannel;
if (flag3) {
2026-07-29 08:29:29 +00:00
const obj = { warningId: null, warningType: null, senderId: null, channelId: null };
({ id: obj5[0], type: obj5[1] } = inappropriateConversationTakeoverForChannel);
obj[2] = channel.getRecipientId();
obj[3] = channelId;
tmp4(17332).showTakeoverModal(obj);
2026-07-20 16:05:17 +00:00
flag3 = true;
const tmp4Result1 = tmp4(17332);
2026-07-20 16:05:17 +00:00
}
return flag3;
}
}
return false;
} else {
return false;
}
} else {
return false;
}
2026-08-24 06:08:38 +00:00
obj6 = InappropriateConversationExperiment;
2026-07-20 16:05:17 +00:00
}
}
function handleChannelUpdates(channels) {
channels = channels.channels;
2026-07-23 10:11:24 +00:00
let currentlySelectedChannelId;
let obj = currentlySelectedChannelId(10968);
2026-07-20 16:05:17 +00:00
if (obj.isEligibleForInappropriateConversationWarning({ location: "channel_updates" })) {
let tmpResult = tmp(11397);
2026-07-29 08:29:29 +00:00
if (tmpResult.getSafetyAlertsSettingOrDefault()) {
2026-07-23 10:11:24 +00:00
currentlySelectedChannelId = currentlySelectedChannelId.getCurrentlySelectedChannelId();
2026-07-20 16:05:17 +00:00
if (null == currentlySelectedChannelId) {
return false;
} else {
const found = channels.find((id) => id.id === currentlySelectedChannelId);
if (null == found) {
return false;
} else {
tmpResult = tmp(11397);
2026-07-29 08:29:29 +00:00
const inappropriateConversationTakeoverForChannel = tmpResult.getInappropriateConversationTakeoverForChannel(found.id);
2026-07-20 16:05:17 +00:00
const tmp6 = null == inappropriateConversationTakeoverForChannel || !found.isDM();
let flag3 = !tmp6;
if (!tmp6) {
2026-07-29 08:29:29 +00:00
obj = { warningId: null, warningType: null, senderId: null, channelId: null };
({ id: obj4[0], type: obj4[1] } = inappropriateConversationTakeoverForChannel);
obj[2] = found.getRecipientId();
obj[3] = found.id;
tmp(17332).showTakeoverModal(obj);
2026-07-20 16:05:17 +00:00
flag3 = true;
const tmpResult1 = tmp(17332);
2026-07-20 16:05:17 +00:00
}
return flag3;
}
}
} else {
return false;
}
} else {
return false;
}
}
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
let prototype = function ChannelSafetyWarningsManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { CHANNEL_SELECT: handleChannelSelect, CHANNEL_UPDATES: handleChannelUpdates };
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
}
prototype = new prototype();
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/self_mod/ChannelSafetyWarningsManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;