decord/source/modules/messages/MessageUtils.tsx

33 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 9912
// Function ID: 9913
2026-07-20 16:05:17 +00:00
// Name: canViewPotentiallyNSFWChannel
2026-08-25 06:04:03 +00:00
// Dependencies: [1391, 1922, 4619, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
2026-08-25 06:04:03 +00:00
// Module 9912 (canViewPotentiallyNSFWChannel)
import shouldShowAgeGateForVoiceChannel from "shouldShowAgeGateForVoiceChannel" /* 4619 */;
2026-08-24 06:08:38 +00:00
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import closure_3 from "mergeGuildAvatar" /* 1922 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/messages/MessageUtils.tsx");
2026-07-20 16:05:17 +00:00
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
const channel = store.getChannel(channel_id);
let tmp3 = null != currentUser && null != channel;
if (tmp3) {
2026-08-24 06:08:38 +00:00
tmp3 = !shouldShowAgeGateForVoiceChannel.isChannelContentGated(channel);
const obj = shouldShowAgeGateForVoiceChannel;
2026-07-20 16:05:17 +00:00
}
return tmp3;
};
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
const channel = store.getChannel(channel_id.channel_id);
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id = channel.guild_id;
}
2026-07-29 08:29:29 +00:00
return guild_id;
2026-07-20 16:05:17 +00:00
};