decord/alpha/source/modules/self_mod/ChannelSafetyWarningsManager.tsx

97 lines
3.8 KiB
TypeScript
Raw Normal View History

// Module ID: 17082
// Function ID: 17083
// Name: ChannelSafetyWarningsManager
// Dependencies: [2044, 2098, 10420, 10928, 17083, 6534, 2]
2026-07-20 16:05:17 +00:00
// Module 17082 (ChannelSafetyWarningsManager)
import SelfModInappropriateConversationExperiment from "SelfModInappropriateConversationExperiment" /* 10420 */;
import ChannelStore from "ChannelStore" /* 2044 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2098 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6534 */;
2026-07-23 10:11:24 +00:00
require = fn;
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" })) {
if (tmp4Result.getSafetyAlertsSettingOrDefault()) {
const channel = ChannelStore.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (channel.isDM()) {
const inappropriateConversationTakeoverForChannel = tmp4(10928).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.warningId, type: obj5.warningType } = inappropriateConversationTakeoverForChannel);
obj.senderId = channel.getRecipientId();
obj.channelId = channelId;
tmp4(17083).showTakeoverModal(obj);
2026-07-20 16:05:17 +00:00
flag3 = true;
const tmp4Result4 = tmp4(17083);
2026-07-20 16:05:17 +00:00
}
return flag3;
}
}
return false;
} else {
return false;
}
tmp4Result = tmp4(10928);
2026-07-20 16:05:17 +00:00
} else {
return false;
}
obj6 = SelfModInappropriateConversationExperiment;
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-07-20 16:05:17 +00:00
if (obj.isEligibleForInappropriateConversationWarning({ location: "channel_updates" })) {
2026-07-29 08:29:29 +00:00
if (tmpResult.getSafetyAlertsSettingOrDefault()) {
currentlySelectedChannelId = SelectedChannelStore.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 {
const inappropriateConversationTakeoverForChannel = tmp(10928).getInappropriateConversationTakeoverForChannel(found.id);
2026-07-20 16:05:17 +00:00
const tmp6 = null == inappropriateConversationTakeoverForChannel || !found.isDM();
let flag3 = !tmp6;
if (!tmp6) {
const obj2 = { warningId: null, warningType: null, senderId: null, channelId: null };
({ id: obj4.warningId, type: obj4.warningType } = inappropriateConversationTakeoverForChannel);
obj2.senderId = found.getRecipientId();
obj2.channelId = found.id;
tmp(17083).showTakeoverModal(obj2);
2026-07-20 16:05:17 +00:00
flag3 = true;
const tmpResult4 = tmp(17083);
2026-07-20 16:05:17 +00:00
}
return flag3;
}
}
} else {
return false;
}
tmpResult = tmp(10928);
2026-07-20 16:05:17 +00:00
} else {
return false;
}
obj = SelfModInappropriateConversationExperiment;
2026-07-20 16:05:17 +00:00
}
const prototype = function ChannelSafetyWarningsManager() {
2026-07-29 08:29:29 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { CHANNEL_SELECT: handleChannelSelect, CHANNEL_UPDATES: handleChannelUpdates };
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
}
const prototype1 = new prototype();
const size = fn(2);
const result = size.fileFinishedImporting("modules/self_mod/ChannelSafetyWarningsManager.tsx");
2026-07-20 16:05:17 +00:00
export default prototype1;