103 lines
5.9 KiB
TypeScript
103 lines
5.9 KiB
TypeScript
/* Metro module 6943; source: modules/stickers/StickerSendability.tsx; dependencies: [1945, 6585, 661, 3802, 4643, 3789, 2] */
|
|
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import PremiumUtils from '../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import StickersPackStore from './StickersPackStore.tsx'; /* Metro dependency 6585 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as StickersUtilsModule from './StickersUtils.tsx'; /* Metro dependency 4643 */
|
|
|
|
function _fun55185(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7121:6, offset: 0x01378437, size: 247 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {SENDABLE: 0};
|
|
object[0] = 'SENDABLE';
|
|
object.SENDABLE_WITH_PREMIUM = 1;
|
|
object[1] = 'SENDABLE_WITH_PREMIUM';
|
|
object.NONSENDABLE = 2;
|
|
object[2] = 'NONSENDABLE';
|
|
object.SENDABLE_WITH_BOOSTED_GUILD = 3;
|
|
object[3] = 'SENDABLE_WITH_BOOSTED_GUILD';
|
|
const getStickerSendability2 = getStickerSendability;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/StickerSendability.tsx');
|
|
exports.StickerSendability = object;
|
|
exports.getStickerSendability = getStickerSendability2;
|
|
exports.isSendableSticker = isSendableSticker;
|
|
function getStickerSendability(a0, a1, a2) { // fn#55186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7121:366, offset: 0x0137852e, size: 427 bytes, params: 4, frame: 20
|
|
var r5;
|
|
var r4;
|
|
var r0;
|
|
var moduleValue2;
|
|
var guildMemberStoreBinding;
|
|
var moduleValue3;
|
|
var binding;
|
|
var stickersPackStoreBinding;
|
|
if (a1 == null) {
|
|
return env0_7.NONSENDABLE;
|
|
}
|
|
const canUseCustomStickersEverywhere2 = (PremiumUtils).canUseCustomStickersEverywhere(a1);
|
|
if (StickersUtilsModule.isStandardSticker(a0)) {
|
|
stickersPackStoreBinding = StickersPackStore;
|
|
r0 = stickersPackStoreBinding.getStickerPack(a0.pack_id) == null ? env0_7.NONSENDABLE : env0_7.SENDABLE;
|
|
} else {
|
|
moduleValue2 = StickersUtilsModule;
|
|
if (moduleValue2.isGuildSticker(a0)) {
|
|
if (a2 != null) {
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
if (guildMemberStoreBinding.getSelfMember(a0.guild_id) == null) {
|
|
r4 = env0_7.NONSENDABLE;
|
|
} else if (a0.available) {
|
|
if (a2.guild_id == null) {
|
|
if (a2.guild_id == null) {
|
|
binding = env0_7;
|
|
r5 = canUseCustomStickersEverywhere2 ? binding.SENDABLE : binding.SENDABLE_WITH_PREMIUM;
|
|
} else {
|
|
moduleValue3 = importAll(3789) /* metro dependency 3789: PermissionUtils */;
|
|
r5 = moduleValue3.can({permission: Permissions.USE_EXTERNAL_STICKERS, user: a1,
|
|
context: a2}) ? canUseCustomStickersEverywhere2 ? env0_7.SENDABLE : env0_7.SENDABLE_WITH_PREMIUM : env0_7.NONSENDABLE;
|
|
}
|
|
} else if (a2.guild_id === '') {
|
|
if (a2.guild_id == null) {
|
|
binding = env0_7;
|
|
r5 = canUseCustomStickersEverywhere2 ? binding.SENDABLE : binding.SENDABLE_WITH_PREMIUM;
|
|
} else {
|
|
moduleValue3 = importAll(3789) /* metro dependency 3789: PermissionUtils */;
|
|
r5 = moduleValue3.can({permission: Permissions.USE_EXTERNAL_STICKERS, user: a1,
|
|
context: a2}) ? canUseCustomStickersEverywhere2 ? env0_7.SENDABLE : env0_7.SENDABLE_WITH_PREMIUM : env0_7.NONSENDABLE;
|
|
}
|
|
} else if (a2.guild_id === a0.guild_id) {
|
|
r5 = env0_7.SENDABLE;
|
|
} else if (a2.guild_id == null) {
|
|
binding = env0_7;
|
|
r5 = canUseCustomStickersEverywhere2 ? binding.SENDABLE : binding.SENDABLE_WITH_PREMIUM;
|
|
} else {
|
|
moduleValue3 = importAll(3789) /* metro dependency 3789: PermissionUtils */;
|
|
r5 = moduleValue3.can({permission: Permissions.USE_EXTERNAL_STICKERS, user: a1,
|
|
context: a2}) ? canUseCustomStickersEverywhere2 ? env0_7.SENDABLE : env0_7.SENDABLE_WITH_PREMIUM : env0_7.NONSENDABLE;
|
|
}
|
|
r4 = r5;
|
|
} else {
|
|
r4 = env0_7.SENDABLE_WITH_BOOSTED_GUILD;
|
|
}
|
|
r0 = r4;
|
|
} else {
|
|
r0 = env0_7.NONSENDABLE;
|
|
}
|
|
} else {
|
|
r0 = env0_7.NONSENDABLE;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isSendableSticker(a0, a1, a2) { // fn#55187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7121:1059, offset: 0x013786d9, size: 41 bytes, params: 4, frame: 16
|
|
const stickerSendability = getStickerSendability(a0, a1, a2);
|
|
const SENDABLE = env0_7.SENDABLE;
|
|
return stickerSendability === SENDABLE;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55185, 6943, [1945, 6585, 661, 3802, 4643, 3789,
|
|
2]) /* metro module 6943, dependencies: [1945, 6585, 661, 3802, 4643, 3789, 2] */;
|