decord/alpha/source/modules/messages/MessageUtils.tsx

33 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 12520
// Function ID: 12521
// Name: MessageUtils
2026-10-09 10:00:15 +00:00
// Dependencies: [2064, 1390, 5931, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
2026-10-09 10:00:15 +00:00
// Module 12520 (MessageUtils)
import AgeGateUtils from "AgeGateUtils" /* 5931 */;
import ChannelStore from "ChannelStore" /* 2064 */;
import UserStore from "UserStore" /* 1390 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
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) {
2026-10-03 08:58:59 +00:00
const obj = AgeGateUtils;
tmp3 = !obj.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
};