2026-10-06 22:12:49 +00:00
|
|
|
// Module ID: 12213
|
|
|
|
|
// Function ID: 12214
|
2026-09-18 20:18:48 +00:00
|
|
|
// Name: MessageUtils
|
2026-10-06 22:12:49 +00:00
|
|
|
// Dependencies: [2051, 1378, 5047, 2]
|
2026-09-18 20:18:48 +00:00
|
|
|
// Exports: canViewPotentiallyNSFWChannel, getGuildIdFromMessage
|
|
|
|
|
|
2026-10-06 22:12:49 +00:00
|
|
|
// Module 12213 (MessageUtils)
|
|
|
|
|
import AgeGateUtils from "AgeGateUtils" /* 5047 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2051 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1378 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 20:18:48 +00:00
|
|
|
|
|
|
|
|
const result = size.fileFinishedImporting("modules/messages/MessageUtils.tsx");
|
|
|
|
|
|
|
|
|
|
export const canViewPotentiallyNSFWChannel = function canViewPotentiallyNSFWChannel(channel_id) {
|
|
|
|
|
const currentUser = UserStore.getCurrentUser();
|
|
|
|
|
const channel = ChannelStore.getChannel(channel_id);
|
|
|
|
|
let tmp3 = null != currentUser && null != channel;
|
|
|
|
|
if (tmp3) {
|
2026-10-06 22:12:49 +00:00
|
|
|
const obj = AgeGateUtils;
|
|
|
|
|
tmp3 = !obj.isChannelContentGated(channel);
|
2026-09-18 20:18:48 +00:00
|
|
|
}
|
|
|
|
|
return tmp3;
|
|
|
|
|
};
|
|
|
|
|
export const getGuildIdFromMessage = function getGuildIdFromMessage(channel_id) {
|
|
|
|
|
const channel = ChannelStore.getChannel(channel_id.channel_id);
|
|
|
|
|
let guild_id;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
guild_id = channel.guild_id;
|
|
|
|
|
}
|
|
|
|
|
return guild_id;
|
|
|
|
|
};
|