decord/source/modules/messages/MessageUtils.tsx

33 lines
1 KiB
TypeScript
Raw Normal View History

// Module ID: 10223
// Function ID: 10224
// Name: MessageUtils
// Dependencies: [1958, 1372, 4849, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
// Module 10223 (MessageUtils)
import AgeGateUtils from "AgeGateUtils" /* 4849 */;
import ChannelStore from "ChannelStore" /* 1958 */;
import UserStore from "UserStore" /* 1372 */;
2026-07-23 10:11:24 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/messages/MessageUtils.tsx");
2026-07-20 16:05:17 +00:00
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
const currentUser = UserStore.getCurrentUser();
const channel = ChannelStore.getChannel(channel_id);
2026-07-20 16:05:17 +00:00
let tmp3 = null != currentUser && null != channel;
if (tmp3) {
tmp3 = !AgeGateUtils.isChannelContentGated(channel);
2026-07-20 16:05:17 +00:00
}
return tmp3;
};
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
const channel = ChannelStore.getChannel(channel_id.channel_id);
2026-07-20 16:05:17 +00:00
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
};