Files
discord-decomp/sources/modules/activities/ActivitiesInTextUtils.tsx
T
2026-07-27 16:20:00 +03:00

77 lines
4.2 KiB
TypeScript

/* Metro module 8448; source: modules/activities/ActivitiesInTextUtils.tsx; dependencies: [1379, 3784, 482, 677, 566, 2] */
function _fun67023(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:6, offset: 0x01c13185, size: 223 bytes, params: 8, frame: 21
let env0_0 = require;
const closure = isActivityInTextSupportedForChannel;
const isActivitiesInTextEnabledForChannelWithPermissions = function(a0, a1) {
if (a0 != null) {
if (a0 === undefined) {
return false;
}
if (isActivityInTextSupportedForChannel(a0)) {
if (a0.guild_id == null) {
return true;
}
if (a1.can(Permissions.USE_EMBEDDED_ACTIVITIES, a0)) {
return true;
}
return false;
}
}
return false;
};
const closure2 = function(a0) {
return a0?.guild_id != null || isActivityInTextSupportedForChannel(a0);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_4 = (require(482) /* metro dependency 482: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/ActivitiesInTextUtils.tsx');
exports.isActivityInTextSupportedForChannel = closure;
exports.isActivitiesInTextEnabled = function(a0) {
return isActivitiesInTextEnabledForChannelWithPermissions(a0, PermissionStore);
};
exports.useIsActivitiesInTextEnabled = function(a0) {
var env0_0 = a0;
return require(dependencyMap[4]).useStateFromStores([ChannelStore, PermissionStore], _fun67029);
};
exports.getIsAppLauncherEnabled = closure2;
exports.useIsAppLauncherEnabled = function(a0) {
var env0_0 = a0;
return require(dependencyMap[4]).useStateFromStores([ChannelStore], _fun67031);
};
}
function isActivityInTextSupportedForChannel(a0) { // fn#67024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:138, offset: 0x01c13264, size: 238 bytes, params: 2, frame: 16
const ChannelTypes = (require(677) /* metro dependency 677: ChannelTypes */).ChannelTypes;
if (a0 == null) {
return false;
}
const channel = ChannelStore.getChannel(a0.parent_id);
return (channel == null || channel?.type === ChannelTypes.GUILD_CATEGORY) && [ChannelTypes.GUILD_TEXT,
ChannelTypes.GUILD_VOICE, ChannelTypes.GROUP_DM, ChannelTypes.DM].includes(a0.type);
}
function useIsActivitiesInTextEnabled(a0) { // fn#67028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:1172, offset: 0x01c133e7, size: 74 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore, PermissionStore],
_fun67029);
}
function useIsAppLauncherEnabled(a0) { // fn#67030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:1407, offset: 0x01c1345b, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun67031);
}
function _fun67029() { // fn#67029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:1254, offset: 0x01c13431, size: 42 bytes, params: 1, frame: 14
return isActivitiesInTextEnabledForChannelWithPermissions(ChannelStore.getChannel(env0_0), PermissionStore);
}
function _fun67031() { // fn#67031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8633:1482, offset: 0x01c1349d, size: 46 bytes, params: 1, frame: 12
const value = environment.__proto__;
const channel = ChannelStore.getChannel(env0_0);
return channel != null && getIsAppLauncherEnabled(channel);
}