114 lines
5.2 KiB
TypeScript
114 lines
5.2 KiB
TypeScript
/* Metro module 8037; source: modules/guild_communication_disabled/useCanToggleCommunicationDisableOnUser.tsx; dependencies: [1422, 1867, 3784, 1878, 661, 3789, 566, 2] */
|
|
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
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 */
|
|
import * as GuildRecordModule from '../../records/GuildRecord.tsx'; /* Metro dependency 1422 */
|
|
|
|
function _fun63726(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8215:6, offset: 0x01b8e2e3, size: 210 bytes, params: 8, frame: 20
|
|
let env0_0 = require;
|
|
const canToggleCommunicationDisableOnUser2 = canToggleCommunicationDisableOnUser;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_communication_disabled/useCanToggleCommunicationDisableOnUser.tsx');
|
|
exports.default = function(a0, a1) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
return require(dependencyMap[6]).useStateFromStores([UserStore, GuildStore, PermissionStore], _fun63729, [a0,
|
|
a1]);
|
|
};
|
|
exports.canToggleCommunicationDisableOnUser = canToggleCommunicationDisableOnUser2;
|
|
function canToggleCommunicationDisableOnUser(a0, a1) { // fn#63727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8215:171, offset: 0x01b8e3b5, size: 306 bytes, params: 3, frame: 21
|
|
var r1;
|
|
var r0;
|
|
var r3;
|
|
var r7;
|
|
var item3;
|
|
var item4;
|
|
var isNonUserBot2;
|
|
let value = a2;
|
|
const value2 = undefined;
|
|
const iterator = (value !== value2 ? value : [UserStore, GuildStore, PermissionStore])[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
let r2 = item2 === value2 ? value2 : item;
|
|
if (value) {
|
|
r0 = item2;
|
|
r1 = value;
|
|
r3 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value = item3 === value2;
|
|
if (value) {
|
|
r0 = item3;
|
|
r1 = value;
|
|
r3 = value2;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = value;
|
|
r3 = item;
|
|
}
|
|
}
|
|
if (r1) {
|
|
r7 = value2;
|
|
} else {
|
|
item4 = Reflect.apply(iterator2, r0, []);
|
|
item = item4.value;
|
|
item4 = item4.done ? undefined : r0;
|
|
value = item4 === value2;
|
|
if (value) {
|
|
r0 = item4;
|
|
r1 = value;
|
|
r7 = value2;
|
|
} else {
|
|
r0 = item4;
|
|
r1 = value;
|
|
r7 = item;
|
|
}
|
|
}
|
|
if (!r1) {
|
|
r0.return();
|
|
}
|
|
value = r3.getGuild(a0);
|
|
const user = r2.getUser(a1);
|
|
r0 = value != null && user != null;
|
|
if (r0) {
|
|
isNonUserBot2 = user.isNonUserBot();
|
|
if (isNonUserBot2) {
|
|
r1 = !isNonUserBot2;
|
|
} else {
|
|
r2 = isGuildOwner(value,
|
|
user) || (importAll(3789) /* metro dependency 3789: PermissionUtils */).can({permission: Permissions.ADMINISTRATOR,
|
|
|
|
|
|
user: user, context: value});
|
|
r2 = !r2 && r7.canManageUser(Permissions.MODERATE_MEMBERS, user, value);
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useCanToggleCommunicationDisableOnUser(a0, a1) { // fn#63728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8215:554, offset: 0x01b8e4e7, size: 100 bytes, params: 3, frame: 18
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return (FluxModule).useStateFromStores([UserStore, GuildStore, PermissionStore],
|
|
_fun63729, [a0, a1]);
|
|
function _fun63729() { // fn#63729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8215:650, offset: 0x01b8e54b, size: 57 bytes, params: 1, frame: 16
|
|
return canToggleCommunicationDisableOnUser(env0_0, require, [UserStore, GuildStore, PermissionStore]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun63726, 8037, [1422, 1867, 3784, 1878, 661, 3789, 566,
|
|
2]) /* metro module 8037, dependencies: [1422, 1867, 3784, 1878, 661, 3789, 566, 2] */;
|