72 lines
5.0 KiB
TypeScript
72 lines
5.0 KiB
TypeScript
/* Metro module 9830; source: modules/messages/useReactionPermissions.tsx; dependencies: [57, 3785, 1945, 4798, 3784, 661, 566, 3790, 8229, 6860, 9831, 2] */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import LurkingStore from '../lurker_mode/LurkingStore.tsx'; /* Metro dependency 3785 */
|
|
import GuildVerificationStore from '../../stores/GuildVerificationStore.tsx'; /* Metro dependency 4798 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun76994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:6, offset: 0x01dec7f1, size: 204 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/messages/useReactionPermissions.tsx');
|
|
exports.default = useReactionPermissions;
|
|
function useReactionPermissions(a0) { // fn#76995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:256, offset: 0x01dec8bd, size: 464 bytes, params: 2, frame: 26
|
|
var r0;
|
|
const env0_0 = a0;
|
|
const guild_id = a0?.guild_id;
|
|
let useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [GuildVerificationStore];
|
|
const value3 = Reflect.apply(useStateFromStores, FluxModule, [object, _fun76996, [guild_id]]);
|
|
const value4 = FluxModule.useStateFromStores([LurkingStore], _fun76997, [guild_id]);
|
|
const value5 = FluxModule.useStateFromStores([GuildMemberStore], _fun76998, [guild_id]);
|
|
useStateFromStores = FluxModule.useStateFromStores;
|
|
if (a0 == null) {
|
|
r0 = {'disableReactionReads': true, 'disableReactionCreates': true, 'disableReactionUpdates': true,
|
|
'isLurking': false, 'isGuest': false, 'isPendingMember': false};
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object,
|
|
(importDefault(9831) /* metro dependency 9831: parseReactionPermissions */)({channel: a0,
|
|
canChat: value3, renderReactions: true, canAddNewReactions: Reflect.apply(useStateFromStores, FluxModule,
|
|
[[PermissionStore], _fun76999, [value3, a0]]), isLurking: value4,
|
|
communicationDisabled: Module00057((require(8229) /* metro dependency 8229: useUserCommunicationDisabled */).useCurrentUserCommunicationDisabled(guild_id),
|
|
|
|
2)[1],
|
|
isActiveChannelOrUnarchivableThread: (require(6860) /* metro dependency 6860: ThreadHooks */).useIsActiveChannelOrUnarchivableThread(a0),
|
|
|
|
isAutomodQuarantined: (require(3790) /* metro dependency 3790: AutomodPermissionUtils */).useCurrentUserAutomodQuaratinedProfile(guild_id)}),
|
|
|
|
undefined);
|
|
object['isLurking'] = value4;
|
|
object['isGuest'] = value5;
|
|
object['isPendingMember'] = false;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
function _fun76996() { // fn#76996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:357, offset: 0x01deca8d, size: 40 bytes, params: 1, frame: 12
|
|
return guild_id == null || GuildVerificationStore.canChatInGuild(guild_id);
|
|
}
|
|
|
|
function _fun76997() { // fn#76997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:430, offset: 0x01decab5, size: 40 bytes, params: 1, frame: 12
|
|
return guild_id != null && LurkingStore.isLurking(guild_id);
|
|
}
|
|
|
|
function _fun76998() { // fn#76998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:498, offset: 0x01decadd, size: 40 bytes, params: 1, frame: 12
|
|
return guild_id != null && GuildMemberStore.isCurrentUserGuest(guild_id);
|
|
}
|
|
|
|
function _fun76999() { // fn#76999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10016:575, offset: 0x01decb05, size: 45 bytes, params: 1, frame: 14
|
|
return env0_2 && PermissionStore.can(Permissions.ADD_REACTIONS, env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun76994, 9830, [57, 3785, 1945, 4798, 3784, 661, 566, 3790, 8229, 6860, 9831,
|
|
2]) /* metro module 9830, dependencies: [57, 3785, 1945, 4798, 3784, 661, 566, 3790, 8229, 6860, 9831, 2] */;
|