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

180 lines
8.1 KiB
TypeScript

/* Metro module 11921; source: modules/guild_communication_disabled/CommunicationDisabledManager.tsx; dependencies: [6, 7, 15, 17, 18, 1945, 1878, 3773, 694, 4860, 2] */
function _fun91420(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:6, offset: 0x02063c65, size: 308 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
let value = require(1945) /* metro dependency 1945: GuildMemberStore */;
const env0_8 = value.getGuildIdFromCommunicationDisabledUserKey;
const env0_9 = value.getUserIdFromCommunicationDisabledUserKey;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun91425(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_communication_disabled/CommunicationDisabledManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_91421() { // fn#91421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:271, offset: 0x02063d99, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_91421_isNativeReflectConstruct = function() {
return !!result;
})();
}
function clearGuildMemberTimeout(a0, a1) { // fn#91424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:499, offset: 0x02063dfb, size: 400 bytes, params: 3, frame: 18
var r7;
var r6;
var value4;
var moduleValue;
var object5;
var avatar;
var value5;
var object6;
var premiumSince;
var value6;
var isPending;
var object7;
var email;
var value8;
var dispatch;
var object8;
var value;
const member = GuildMemberStore.getMember(a0, a1);
const user = UserStore.getUser(a1);
if (member != null) {
if (user != null) {
value4 = undefined;
moduleValue = require(3773) /* metro dependency 3773: CommunicationDisabledUtils */;
if (!moduleValue.isMemberCommunicationDisabled(member)) {
object5 = {};
copyDataProperties(object5, member, undefined);
object5['guildId'] = a0;
r7 = member.nick ?? user.username;
object5['nick'] = r7;
avatar = member.avatar;
value5 = avatar != null;
r7 = value5 ? avatar : value4;
object5['avatar'] = r7;
if (member.avatarDecoration != null) {
object6 = {};
copyDataProperties(object6, member.avatarDecoration, value5);
r7 = object6;
} else {
r7 = value4;
}
object5['avatarDecoration'] = r7;
premiumSince = member.premiumSince;
value6 = premiumSince != null;
r7 = value6 ? premiumSince : value4;
object5['premiumSince'] = r7;
isPending = member.isPending;
r6 = isPending != null && isPending;
object5['isPending'] = r6;
object7 = {};
copyDataProperties(object7, user, value6);
email = user.email;
value8 = email != null;
r7 = value8 ? email : value4;
object7['email'] = r7;
r6 = user.phone ?? value4;
object7['phone'] = r6;
object5['user'] = object7;
object5['communicationDisabledUntil'] = null;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
dispatch = value.dispatch;
object8 = {type: 'GUILD_MEMBER_UPDATE'};
copyDataProperties(object8, object5, value8);
Reflect.apply(dispatch, value, [object8]);
}
}
}
}
function _fun91425(a0) { // fn#91425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1039, offset: 0x02063f8b, size: 97 bytes, params: 2, frame: 16
const closure = CommunicationDisabledManager;
env0_7(closure, a0);
return env0_4(closure, [{key: '_initialize', value: function() {
env1_12 = global.setInterval(_fun91428, 10000);
}}, {key: '_terminate', value: value_91430}]);
}
function CommunicationDisabledManager(a0) { // fn#91426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1051, offset: 0x02063fec, size: 136 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_3;
binding(this, CommunicationDisabledManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_6(CommunicationDisabledManager);
binding = env1_5;
if (_isNativeReflectConstruct_91421()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.clearGuildMemberTimeout = clearGuildMemberTimeout;
return value;
}
function value_91427() { // fn#91427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1471, offset: 0x02064074, size: 40 bytes, params: 1, frame: 13
const value = global.setInterval(_fun91428, 10000);
}
function value_91430() { // fn#91430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1716, offset: 0x0206412f, size: 24 bytes, params: 1, frame: 11
global.clearInterval(env1_12);
}
function _fun91428() { // fn#91428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1497, offset: 0x0206409c, size: 64 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__.__proto__;
value = GuildMemberStore.getCommunicationDisabledUserMap();
const Object = global.Object;
value = Object.keys(value);
value.forEach(_fun91429);
}
function _fun91429(a0) { // fn#91429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12107:1576, offset: 0x020640dc, size: 83 bytes, params: 2, frame: 17
const guildIdFromCommunicationDisabledUserKey = getGuildIdFromCommunicationDisabledUserKey(a0);
const userIdFromCommunicationDisabledUserKey = getUserIdFromCommunicationDisabledUserKey(a0);
const property = env0_0[a0];
const communicationDisabledUtilsModule = require(3773) /* metro dependency 3773: CommunicationDisabledUtils */;
if (!communicationDisabledUtilsModule.isCommunicationDisabled(property)) {
clearGuildMemberTimeout(guildIdFromCommunicationDisabledUserKey, userIdFromCommunicationDisabledUserKey);
}
}