decord/source/modules/self_mod/ChannelSafetyWarningsManager.tsx

99 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16671
// Function ID: 16672
2026-07-29 08:29:29 +00:00
// Name: handleChannelSelect
2026-08-25 06:04:03 +00:00
// Dependencies: [1391, 1981, 10413, 10448, 16672, 5367, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 16671 (handleChannelSelect)
import initializeDefault from "initialize" /* 5367 */;
import InappropriateConversationExperiment from "InappropriateConversationExperiment" /* 10413 */;
2026-08-24 06:08:38 +00:00
import closure_2 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_3 from "handleConnectionOpen" /* 1981 */;
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" })) {
2026-08-25 06:04:03 +00:00
let tmp4Result = tmp4(10448);
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()) {
2026-08-25 06:04:03 +00:00
tmp4Result = tmp4(10448);
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;
2026-08-25 06:04:03 +00:00
tmp4(16672).showTakeoverModal(obj);
2026-07-20 16:05:17 +00:00
flag3 = true;
2026-08-25 06:04:03 +00:00
const tmp4Result1 = tmp4(16672);
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;
2026-08-25 06:04:03 +00:00
let obj = currentlySelectedChannelId(10413);
2026-07-20 16:05:17 +00:00
if (obj.isEligibleForInappropriateConversationWarning({ location: "channel_updates" })) {
2026-08-25 06:04:03 +00:00
let tmpResult = tmp(10448);
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 {
2026-08-25 06:04:03 +00:00
tmpResult = tmp(10448);
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;
2026-08-25 06:04:03 +00:00
tmp(16672).showTakeoverModal(obj);
2026-07-20 16:05:17 +00:00
flag3 = true;
2026-08-25 06:04:03 +00:00
const tmpResult1 = tmp(16672);
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;