2026-09-11 19:12:58 +00:00
|
|
|
// Module ID: 10174
|
|
|
|
|
// Function ID: 10175
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: MessageUtils
|
2026-09-11 19:12:58 +00:00
|
|
|
// Dependencies: [1957, 1371, 4817, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
|
|
|
|
|
|
2026-09-11 19:12:58 +00:00
|
|
|
// Module 10174 (MessageUtils)
|
|
|
|
|
import AgeGateUtils from "AgeGateUtils" /* 4817 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 1957 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1371 */;
|
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
|
|
|
};
|