111 lines
6.7 KiB
TypeScript
111 lines
6.7 KiB
TypeScript
/* Metro module 15837; source: modules/urgent_system_dm/UrgentSystemDMManagerBase.tsx; dependencies: [7, 6, 15, 17, 18, 1379, 1934, 1878, 15838, 661, 8061, 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 ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import AutomaticLifecycleManager from '../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ConstantsModule2 from './Constants.tsx'; /* Metro dependency 15838 */
|
|
|
|
function _fun121766(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:6, offset: 0x02550c72, size: 329 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = AutomaticLifecycleManager;
|
|
value = _fun121772(value);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/urgent_system_dm/UrgentSystemDMManagerBase.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_121767() { // fn#121767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:220, offset: 0x02550dbb, 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_121767_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function maybeShowUrgentMessageModal(a0) { // fn#121770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:422, offset: 0x02550e1d, size: 117 bytes, params: 2, frame: 14
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser != null) {
|
|
var channelId = SelectedChannelStore.getChannelId();
|
|
if (currentUser.hasUrgentMessages()) {
|
|
if (ChannelStore.getDMFromUserId(SYSTEM_USER) === channelId) {
|
|
maybeClearUrgentMessage({channelId: channelId});
|
|
return undefined;
|
|
}
|
|
if (!env0_12) {
|
|
a0();
|
|
}
|
|
return undefined;
|
|
}
|
|
maybeClearUrgentMessage({channelId: channelId});
|
|
}
|
|
}
|
|
|
|
function maybeClearUrgentMessage({channelId}) { // fn#121771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:639, offset: 0x02550e92, size: 129 bytes, params: 2, frame: 15
|
|
var moduleValue;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const channelStoreBinding = ChannelStore;
|
|
const getDMFromUserId = channelStoreBinding.getDMFromUserId;
|
|
if (currentUser != null && currentUser.hasUrgentMessages() && channelId === Reflect.apply(getDMFromUserId,
|
|
channelStoreBinding, [SYSTEM_USER])) {
|
|
moduleValue = importAll(8061) /* metro dependency 8061: UserActionCreators */;
|
|
moduleValue.setFlag(UserFlags.HAS_UNREAD_URGENT_MESSAGES, false);
|
|
}
|
|
}
|
|
|
|
function _fun121772(a0) { // fn#121772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:837, offset: 0x02550f13, size: 42 bytes, params: 2, frame: 14
|
|
const UrgentSystemDMManagerBase2 = UrgentSystemDMManagerBase;
|
|
Inherits(UrgentSystemDMManagerBase2, a0);
|
|
return CreateClass(UrgentSystemDMManagerBase2);
|
|
function UrgentSystemDMManagerBase(a0) { // fn#121773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:849, offset: 0x02550f3d, size: 164 bytes, params: 2, frame: 21
|
|
env1_3(this, UrgentSystemDMManagerBase);
|
|
const value3 = env1_5(UrgentSystemDMManagerBase);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_121767() ? global.Reflect.construct(value3, [],
|
|
env1_5(this).constructor) : value3.apply(this, undefined));
|
|
value6.handleShowUrgentMessageAlert = a0;
|
|
value6.actions = {POST_CONNECTION_OPEN: POST_CONNECTION_OPEN_121774, MESSAGE_CREATE: MESSAGE_CREATE_121775,
|
|
CHANNEL_SELECT: maybeClearUrgentMessage};
|
|
return value6;
|
|
function UrgentSystemDMManagerBasePOST_CONNECTION_OPEN() { // fn#121774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:1165, owner: UrgentSystemDMManagerBase.POST_CONNECTION_OPEN, offset: 0x02550fe1, size: 29 bytes, params: 1, frame: 11
|
|
maybeShowUrgentMessageModal(env0_0.handleShowUrgentMessageAlert);
|
|
}
|
|
|
|
function UrgentSystemDMManagerBaseMESSAGE_CREATE() { // fn#121775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16045:1244, owner: UrgentSystemDMManagerBase.MESSAGE_CREATE, offset: 0x02550fe1, size: 29 bytes, params: 1, frame: 11
|
|
maybeShowUrgentMessageModal(env0_0.handleShowUrgentMessageAlert);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun121766, 15837, [7, 6, 15, 17, 18, 1379, 1934, 1878, 15838, 661, 8061, 4860,
|
|
2]) /* metro module 15837, dependencies: [7, 6, 15, 17, 18, 1379, 1934, 1878, 15838, 661, 8061, 4860, 2] */;
|