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

203 lines
11 KiB
TypeScript

/* Metro module 12997; source: modules/a11y/native/AccessibilityCallManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 3793, 1878, 477, 3829, 4805, 4002, 1244, 694, 4561, 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 Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
function _fun99133(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:6, offset: 0x021bbcdc, size: 365 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const Set = global.Set;
const set = new Set();
const Map = global.Map;
let map = new Map();
map = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
map = _fun99138(map);
map = new map();
(FileImportTrackerModule).fileFinishedImporting('modules/a11y/native/AccessibilityCallManager.tsx');
exports.default = map;
function _isNativeReflectConstruct_99134() { // fn#99134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:188, offset: 0x021bbe49, 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_99134_isNativeReflectConstruct = function() {
return !!result;
})();
}
function announceIncomingCall(a0) { // fn#99137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:405, offset: 0x021bbeab, size: 292 bytes, params: 2, frame: 19
var moduleValue;
var NativePhoneIntegrationEnabled;
var channel;
var moduleValue2;
var channelName;
const AccessibilityAnnouncer = (SharedModule).AccessibilityAnnouncer;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const binding = env0_12;
if (!binding.has(a0)) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isIOS()) {
NativePhoneIntegrationEnabled = (require(3829) /* metro dependency 3829: UserSettings */).NativePhoneIntegrationEnabled;
if (!NativePhoneIntegrationEnabled.getSetting()) {
channel = ChannelStore.getChannel(a0);
if (channel != null) {
moduleValue2 = require(4805) /* metro dependency 4805: useChannelName */;
channelName = moduleValue2.computeChannelName(channel, UserStore, RelationshipStore);
if (channelName != null) {
env0_12.add(a0);
AccessibilityAnnouncer.announce(intl.formatToPlainString(t['Bm0A/p'],
{callLocation: channelName}),
'assertive');
}
}
}
} else {
channel = ChannelStore.getChannel(a0);
if (channel != null) {
moduleValue2 = require(4805) /* metro dependency 4805: useChannelName */;
channelName = moduleValue2.computeChannelName(channel, UserStore, RelationshipStore);
if (channelName != null) {
env0_12.add(a0);
AccessibilityAnnouncer.announce(intl.formatToPlainString(t['Bm0A/p'], {callLocation: channelName}),
'assertive');
}
}
}
}
}
function _fun99138(a0) { // fn#99138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:758, offset: 0x021bbfcf, size: 97 bytes, params: 2, frame: 16
const AccessibilityCallManager2 = AccessibilityCallManager;
Inherits(AccessibilityCallManager2, a0);
return CreateClass(AccessibilityCallManager2, [{key: '_initialize', value: value_99144}, {key: '_terminate',
value: value_99145}]);
function AccessibilityCallManager(a0) { // fn#99139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:770, offset: 0x021bc030, size: 180 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_3;
binding(this, AccessibilityCallManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_6(AccessibilityCallManager);
binding = env1_5;
if (_isNativeReflectConstruct_99134()) {
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.handleCallCreate = handleCallCreate;
value.handleCallUpdate = handleCallUpdate;
value.handleCallDelete = handleCallDelete_99142;
value.handleConnectionOpen = handleConnectionOpen_99143;
return value;
function handleCallCreate({channelId, ongoingRings}) { // fn#99140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1047, owner: AccessibilityCallManager.handleCallCreate, offset: 0x021bc0e4, size: 77 bytes, params: 2, frame: 15
const id = AuthenticationStore.getId();
const r1 = id != null && id in ongoingRings;
env2_13.set(channelId, r1);
if (r1) {
announceIncomingCall(channelId);
}
}
function handleCallUpdate({channelId, ongoingRings}) { // fn#99141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1172, owner: AccessibilityCallManager.handleCallUpdate, offset: 0x021bc131, size: 129 bytes, params: 2, frame: 17
const id = AuthenticationStore.getId();
const value3 = env2_13.get(channelId);
let r1 = value3 != null && value3;
const r3 = id != null && id in ongoingRings;
env2_13.set(channelId, r3);
if (r1) {
r1 = r1 && !r3;
if (r1) {
env2_12.delete(channelId);
}
} else if (r3) {
announceIncomingCall(channelId);
} else {
r1 = r1 && !r3;
if (r1) {
env2_12.delete(channelId);
}
}
}
function AccessibilityCallManagerHandleCallDelete({channelId}) { // fn#99142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1345, owner: AccessibilityCallManager.handleCallDelete, offset: 0x021bc1b2, size: 43 bytes, params: 2, frame: 12
env2_13.delete(channelId);
env2_12.delete(channelId);
}
function AccessibilityCallManagerHandleConnectionOpen() { // fn#99143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1411, owner: AccessibilityCallManager.handleConnectionOpen, offset: 0x021bc1dd, size: 35 bytes, params: 1, frame: 10
env2_13.clear();
env2_12.clear();
}
}
function value_99144() { // fn#99144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1529, offset: 0x021bc200, size: 145 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('CALL_CREATE', this.handleCallCreate);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('CALL_UPDATE', this.handleCallUpdate);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('CALL_DELETE', this.handleCallDelete);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('CONNECTION_OPEN', this.handleConnectionOpen);
}
function value_99145() { // fn#99145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13187:1798, offset: 0x021bc291, size: 173 bytes, params: 1, frame: 19
const defaultImport = Dispatcher;
defaultImport.unsubscribe('CALL_CREATE', this.handleCallCreate);
const defaultImport2 = defaultImport;
defaultImport2.unsubscribe('CALL_UPDATE', this.handleCallUpdate);
const defaultImport3 = defaultImport;
defaultImport3.unsubscribe('CALL_DELETE', this.handleCallDelete);
const defaultImport4 = defaultImport;
defaultImport4.unsubscribe('CONNECTION_OPEN', this.handleConnectionOpen);
env1_13.clear();
env1_12.clear();
}
}
}
global.__d(_fun99133, 12997, [6, 7, 15, 17, 18, 1226, 1379, 3793, 1878, 477, 3829, 4805, 4002, 1244, 694, 4561,
2]) /* metro module 12997, dependencies: [6, 7, 15, 17, 18, 1226, 1379, 3793, 1878, 477, 3829, 4805, 4002, 1244, 694, 4561, 2] */;