2026-09-16 07:03:15 +00:00
|
|
|
// Module ID: 10223
|
|
|
|
|
// Function ID: 10224
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: MessageUtils
|
2026-09-16 07:03:15 +00:00
|
|
|
// Dependencies: [1958, 1372, 4849, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
|
|
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
// Module 10223 (MessageUtils)
|
|
|
|
|
import AgeGateUtils from "AgeGateUtils" /* 4849 */;
|
2026-09-15 14:23:42 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 1958 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1372 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +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) {
|
2026-09-10 05:38:07 +00:00
|
|
|
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-09-10 05:38:07 +00:00
|
|
|
tmp3 = !AgeGateUtils.isChannelContentGated(channel);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return tmp3;
|
|
|
|
|
};
|
|
|
|
|
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
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
|
|
|
};
|