Files
discord-decomp/sources/modules/guild_communication_disabled/CommunicationDisabledManager.tsx
T
2026-07-28 01:06:53 +03:00

185 lines
9.5 KiB
TypeScript

/* Metro module 11921; source: modules/guild_communication_disabled/CommunicationDisabledManager.tsx; dependencies: [6, 7, 15, 17, 18, 1945, 1878, 3773, 694, 4860, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as GuildMemberStoreModule from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
import * as CommunicationDisabledUtilsModule from './CommunicationDisabledUtils.tsx'; /* Metro dependency 3773 */
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});
let value = GuildMemberStoreModule;
const env0_8 = value.getGuildIdFromCommunicationDisabledUserKey;
const env0_9 = value.getUserIdFromCommunicationDisabledUserKey;
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun91425(value);
value = new value();
(FileImportTrackerModule).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 object;
var avatar;
var value5;
var object2;
var premiumSince;
var value6;
var isPending;
var object3;
var email;
var value8;
var dispatch;
var object4;
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)) {
object = {};
copyDataProperties(object, member, undefined);
object['guildId'] = a0;
r7 = member.nick ?? user.username;
object['nick'] = r7;
avatar = member.avatar;
value5 = avatar != null;
r7 = value5 ? avatar : value4;
object['avatar'] = r7;
if (member.avatarDecoration != null) {
object2 = {};
copyDataProperties(object2, member.avatarDecoration, value5);
r7 = object2;
} else {
r7 = value4;
}
object['avatarDecoration'] = r7;
premiumSince = member.premiumSince;
value6 = premiumSince != null;
r7 = value6 ? premiumSince : value4;
object['premiumSince'] = r7;
isPending = member.isPending;
r6 = isPending != null && isPending;
object['isPending'] = r6;
object3 = {};
copyDataProperties(object3, user, value6);
email = user.email;
value8 = email != null;
r7 = value8 ? email : value4;
object3['email'] = r7;
r6 = user.phone ?? value4;
object3['phone'] = r6;
object['user'] = object3;
object['communicationDisabledUntil'] = null;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
dispatch = value.dispatch;
object4 = {type: 'GUILD_MEMBER_UPDATE'};
copyDataProperties(object4, object, value8);
Reflect.apply(dispatch, value, [object4]);
}
}
}
}
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 CommunicationDisabledManager2 = CommunicationDisabledManager;
Inherits(CommunicationDisabledManager2, a0);
return CreateClass(CommunicationDisabledManager2, [{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 _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];
if (!CommunicationDisabledUtilsModule.isCommunicationDisabled(property)) {
clearGuildMemberTimeout(guildIdFromCommunicationDisabledUserKey, userIdFromCommunicationDisabledUserKey);
}
}
}
}
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);
}
}
}
global.__d(_fun91420, 11921, [6, 7, 15, 17, 18, 1945, 1878, 3773, 694, 4860,
2]) /* metro module 11921, dependencies: [6, 7, 15, 17, 18, 1945, 1878, 3773, 694, 4860, 2] */;