decord/source/modules/messages/MessageUtils.tsx

33 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 10013
// Function ID: 10014
2026-07-20 16:05:17 +00:00
// Name: canViewPotentiallyNSFWChannel
// Dependencies: [1386, 1921, 4739, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
// Module 10013 (canViewPotentiallyNSFWChannel)
import shouldShowAgeGateForVoiceChannel from "shouldShowAgeGateForVoiceChannel" /* 4739 */;
2026-09-02 09:53:35 +00:00
import closure_2 from "ensureGuildLoaded" /* 1386 */;
import closure_3 from "mergeGuildAvatar" /* 1921 */;
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
};