decord/source/modules/user_profile/hooks/useCanDM.tsx

90 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 12389
// Function ID: 12390
2026-07-20 16:05:17 +00:00
// Name: useCanDM
2026-08-24 06:08:38 +00:00
// Dependencies: [5411, 4025, 1218, 1991, 4033, 4069, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: canDm, default
2026-08-24 06:08:38 +00:00
// Module 12389 (useCanDM)
import closure_2 from "recountRelationshipTypes" /* 5411 */;
import closure_3 from "initialize" /* 4025 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "trackCommunicationDisabled" /* 1991 */;
import closure_6 from "markAllUserIdListsStale" /* 4033 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/hooks/useCanDM.tsx");
2026-07-20 16:05:17 +00:00
export default function useCanDM(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
dependencyMap = arg1;
const items = [closure_4];
closure_2 = _require(589).useStateFromStores(items, () => id.getId() === closure_0);
2026-07-29 08:29:29 +00:00
const obj = _require(589);
2026-08-24 06:08:38 +00:00
const items1 = [closure_3];
closure_3 = _require(589).useStateFromStores(items1, () => {
2026-07-23 10:11:24 +00:00
let isLurkingResult = null != closure_1;
2026-07-20 16:05:17 +00:00
if (isLurkingResult) {
2026-07-29 08:29:29 +00:00
isLurkingResult = lurking.isLurking(tmp);
2026-07-20 16:05:17 +00:00
}
return isLurkingResult;
});
2026-08-24 06:08:38 +00:00
const RestrictedGuildIds = _require(4069).RestrictedGuildIds;
closure_4 = RestrictedGuildIds.useSetting();
2026-07-29 08:29:29 +00:00
const obj2 = _require(589);
2026-08-24 06:08:38 +00:00
const items2 = [closure_6, closure_5, closure_2];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items2, () => {
2026-07-20 16:05:17 +00:00
let tmp = !gameFriendsForUser;
2026-07-29 08:29:29 +00:00
if (!gameFriendsForUser) {
2026-08-24 06:08:38 +00:00
tmp = !closure_3;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-08-24 06:08:38 +00:00
let isFriendResult = closure_1_6.isFriend(callback);
2026-07-20 16:05:17 +00:00
if (!isFriendResult) {
2026-08-24 06:08:38 +00:00
isFriendResult = null != closure_1_5.memberOf(tmp4).find((arg0) => !closure_4.includes(arg0));
const memberOfResult = closure_1_5.memberOf(tmp4);
2026-07-20 16:05:17 +00:00
}
tmp = isFriendResult;
2026-07-29 08:29:29 +00:00
tmp4 = callback;
2026-07-20 16:05:17 +00:00
}
if (!tmp) {
2026-07-23 10:11:24 +00:00
let setting = gameFriendsForUser.getGameFriendsForUser(callback).length > 0;
2026-07-20 16:05:17 +00:00
if (setting) {
2026-07-23 10:11:24 +00:00
const AllowGameFriendDmsInDiscord = callback(table[5]).AllowGameFriendDmsInDiscord;
2026-07-20 16:05:17 +00:00
setting = AllowGameFriendDmsInDiscord.getSetting();
}
tmp = setting;
}
return tmp;
});
};
2026-07-29 08:29:29 +00:00
export const canDm = function canDm(userId, guildId) {
let isLurkingResult = null != guildId;
id = id.getId();
2026-07-20 16:05:17 +00:00
if (isLurkingResult) {
2026-07-29 08:29:29 +00:00
isLurkingResult = lurking.isLurking(guildId);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const RestrictedGuildIds = _require(4069).RestrictedGuildIds;
2026-07-23 10:11:24 +00:00
_require = RestrictedGuildIds.getSetting();
2026-07-29 08:29:29 +00:00
let isFriendResult = friend.isFriend(userId);
let tmp8 = !tmp4;
if (id !== userId) {
tmp8 = !isLurkingResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp8) {
2026-07-20 16:05:17 +00:00
if (!isFriendResult) {
2026-08-24 06:08:38 +00:00
isFriendResult = null != closure_5.memberOf(userId).find((arg0) => !closure_0.includes(arg0));
const memberOfResult = closure_5.memberOf(userId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = isFriendResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp8) {
let setting = gameFriendsForUser.getGameFriendsForUser(userId).length > 0;
2026-07-20 16:05:17 +00:00
if (setting) {
2026-08-24 06:08:38 +00:00
const AllowGameFriendDmsInDiscord = _require(4069).AllowGameFriendDmsInDiscord;
2026-07-20 16:05:17 +00:00
setting = AllowGameFriendDmsInDiscord.getSetting();
}
2026-07-29 08:29:29 +00:00
tmp8 = setting;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
};