decord/source/modules/self_mod/ChannelSafetyWarningsManager.tsx
github-actions 7450227d0b chore: update source for alpha 345.4
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9596_m.js (380.6 MB)
2026-09-04 17:41:35 +00:00

98 lines
3.7 KiB
TypeScript

// Module ID: 17251
// Function ID: 17252
// Name: handleChannelSelect
// Dependencies: [1386, 1980, 10899, 11329, 17252, 7058, 2]
// Module 17251 (handleChannelSelect)
import initializeDefault from "initialize" /* 7058 */;
import InappropriateConversationExperiment from "InappropriateConversationExperiment" /* 10899 */;
import closure_2 from "ensureGuildLoaded" /* 1386 */;
import closure_3 from "handleConnectionOpen" /* 1980 */;
require = arg1;
function handleChannelSelect(channelId) {
channelId = channelId.channelId;
if (null == channelId) {
return false;
} else {
if (obj6.isEligibleForInappropriateConversationWarning({ location: "channel_select" })) {
let tmp4Result = tmp4(11329);
if (tmp4Result.getSafetyAlertsSettingOrDefault()) {
channel = channel.getChannel(channelId);
if (null != channel) {
if (channel.isDM()) {
tmp4Result = tmp4(11329);
const inappropriateConversationTakeoverForChannel = tmp4Result.getInappropriateConversationTakeoverForChannel(channelId);
let flag3 = null != inappropriateConversationTakeoverForChannel;
if (flag3) {
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(17252).showTakeoverModal(obj);
flag3 = true;
const tmp4Result1 = tmp4(17252);
}
return flag3;
}
}
return false;
} else {
return false;
}
} else {
return false;
}
obj6 = InappropriateConversationExperiment;
}
}
function handleChannelUpdates(channels) {
channels = channels.channels;
let currentlySelectedChannelId;
let obj = currentlySelectedChannelId(10899);
if (obj.isEligibleForInappropriateConversationWarning({ location: "channel_updates" })) {
let tmpResult = tmp(11329);
if (tmpResult.getSafetyAlertsSettingOrDefault()) {
currentlySelectedChannelId = currentlySelectedChannelId.getCurrentlySelectedChannelId();
if (null == currentlySelectedChannelId) {
return false;
} else {
const found = channels.find((id) => id.id === currentlySelectedChannelId);
if (null == found) {
return false;
} else {
tmpResult = tmp(11329);
const inappropriateConversationTakeoverForChannel = tmpResult.getInappropriateConversationTakeoverForChannel(found.id);
const tmp6 = null == inappropriateConversationTakeoverForChannel || !found.isDM();
let flag3 = !tmp6;
if (!tmp6) {
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(17252).showTakeoverModal(obj);
flag3 = true;
const tmpResult1 = tmp(17252);
}
return flag3;
}
}
} else {
return false;
}
} else {
return false;
}
}
initializeDefault;
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();
const result = require("set").fileFinishedImporting("modules/self_mod/ChannelSafetyWarningsManager.tsx");
export default prototype;