decord/source/modules/shared_space_warnings/SharedSpacesWarningManager.tsx

139 lines
4.9 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 12721
// Function ID: 98990
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-27 11:26:19 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1348, 4203, 3768, 12722, 12720, 664, 12723, 668, 12727, 5078, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 12721 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_3 from "_isNativeReflectConstruct";
import set from "set";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import closure_7 from "_isNativeReflectConstruct";
import closure_8 from "_isNativeReflectConstruct";
import closure_9 from "_isNativeReflectConstruct";
import useSharedSpacesWarningStore from "useSharedSpacesWarningStore";
import closure_15 from "_isNativeReflectConstruct";
import tmp3 from "AutomaticLifecycleManager";
let closure_10;
let closure_11;
let closure_12;
let closure_13;
let closure_14;
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function handleChannelSelect(channelId) {
channelId = channelId.channelId;
if (null != channelId) {
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (channel.isGroupDM()) {
const recipients = channel.recipients;
2026-07-23 10:11:24 +00:00
const found = recipients.filter((arg0) => outer1_9.isBlocked(arg0));
2026-07-20 16:05:17 +00:00
const recipients1 = channel.recipients;
2026-07-23 10:11:24 +00:00
const found1 = recipients1.filter((arg0) => outer1_9.isIgnored(arg0));
2026-07-20 16:05:17 +00:00
if (tmp) {
let blockedUserWarningDismissed = channel.blockedUserWarningDismissed;
if (!blockedUserWarningDismissed) {
const tmp3 = callback3(channelId);
let num2 = 0;
if (null != tmp3) {
num2 = tmp3;
}
const _Date = Date;
blockedUserWarningDismissed = num2 > Date.now() - closure_16;
}
if (!blockedUserWarningDismissed) {
2026-07-27 11:26:19 +00:00
let obj = require(12723) /* showGdmBlockedUserModal */;
2026-07-20 16:05:17 +00:00
obj = { channelId, blockedUserIds: found, ignoredUserIds: found1 };
const result = obj.showGdmBlockedUserModal(obj);
}
}
2026-07-23 10:11:24 +00:00
tmp = found.length > 0 || found1.length > 0;
2026-07-20 16:05:17 +00:00
}
}
}
}
function handleAppStateChanged(state) {
2026-07-23 10:11:24 +00:00
if (state.state === require(668) /* keys */.AppStates.ACTIVE) {
channelId = channelId.getChannelId();
2026-07-20 16:05:17 +00:00
if (null != channelId) {
const blockedUsersForVoiceChannel = authStore.getBlockedUsersForVoiceChannel(channelId);
const ignoredUsersForVoiceChannel = authStore.getIgnoredUsersForVoiceChannel(channelId);
if (blockedUsersForVoiceChannel.size > 0) {
if (callback6()) {
const _Set = Set;
const items = [];
HermesBuiltin.arraySpread(ignoredUsersForVoiceChannel, HermesBuiltin.arraySpread(blockedUsersForVoiceChannel, 0));
const set = new Set(items);
if (!voiceBlockedWarningInCooldownForUsers(set)) {
const items1 = [];
HermesBuiltin.arraySpread(ignoredUsersForVoiceChannel, HermesBuiltin.arraySpread(blockedUsersForVoiceChannel, 0));
2026-07-27 11:26:19 +00:00
const result = require(12727) /* showVoiceChannelBlockedUserWarning */.showVoiceChannelBlockedUserWarning(channelId, items1[0]);
const obj = require(12727) /* showVoiceChannelBlockedUserWarning */;
2026-07-20 16:05:17 +00:00
}
}
}
callback7();
} else {
callback7();
}
}
}
function isGlobalDismissTimestampInCooldown() {
const tmp = callback5();
let num = 0;
if (null != tmp) {
num = tmp;
}
return num > Date.now() - HOUR;
}
function voiceBlockedWarningInCooldownForUsers(set) {
let everyResult = isGlobalDismissTimestampInCooldown();
if (!everyResult) {
const _Array = Array;
2026-07-23 10:11:24 +00:00
everyResult = Array.from(set).every((arg0) => outer1_24(arg0, true));
2026-07-20 16:05:17 +00:00
const arr = Array.from(set);
}
return everyResult;
}
function userBlockedWarningInCooldown(arg0) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
if (!flag) {
flag = !isGlobalDismissTimestampInCooldown();
}
let tmp2 = !flag;
if (!tmp2) {
const tmp5 = callback4(arg0);
let num = 0;
if (null != tmp5) {
num = tmp5;
}
const _Date = Date;
tmp2 = num > Date.now() - closure_17;
}
return tmp2;
}
2026-07-23 10:11:24 +00:00
({ getChannelDismissTimestamp: closure_10, getUserDismissTimestamp: closure_11, getGlobalDismissTimestamp: closure_12, isBlockedWarningQueued: closure_13, dequeueBlockWarning: closure_14 } = useSharedSpacesWarningStore);
let closure_16 = 3 * require("set").Millis.DAY;
let closure_17 = 2 * require("set").Millis.DAY;
const HOUR = require("set").Millis.HOUR;
2026-07-20 16:05:17 +00:00
tmp3 = new tmp3();
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/shared_space_warnings/SharedSpacesWarningManager.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;
export { voiceBlockedWarningInCooldownForUsers };
export { userBlockedWarningInCooldown };