130 lines
6.9 KiB
TypeScript
130 lines
6.9 KiB
TypeScript
/* Metro module 8216; source: modules/messages/native/MessageAccessibilityActions.tsx; dependencies: [4798, 3784, 661, 3829, 8217, 1244, 8220, 8228, 2] */
|
|
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import GuildVerificationStore from '../../../stores/GuildVerificationStore.tsx'; /* Metro dependency 4798 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
|
|
import * as DoubleTapExpandExperimentModule from '../../double_tap_to_react/native/DoubleTapExpandExperiment.tsx'; /* Metro dependency 8220 */
|
|
import * as CanReplyToMessageModule from '../../replies/canReplyToMessage.tsx'; /* Metro dependency 8228 */
|
|
|
|
function _fun65778(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8401:6, offset: 0x01bde2c0, size: 258 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/messages/native/MessageAccessibilityActions.tsx');
|
|
exports.MessageAccessibilityAction = {VIEW_PROFILE: 'view_profile', ADD_REACTION: 'add_reaction',
|
|
ADD_QUICK_REACTION: 'add_quick_reaction', REPLY: 'reply', MESSAGE_ACTIONS_MENU: 'message_actions_menu',
|
|
EDIT_GDM: 'edit_gdm'};
|
|
exports.getMessageAccessibilityActionFromLabel = getMessageAccessibilityActionFromLabel;
|
|
exports.createMessageAccessibilityActions = createMessageAccessibilityActions;
|
|
function getQuickReactionLabel() { // fn#65779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8401:352, offset: 0x01bde3c2, size: 307 bytes, params: 1, frame: 19
|
|
var r2;
|
|
const DoubleTapExpandExperiment = (DoubleTapExpandExperimentModule).DoubleTapExpandExperiment;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const value2 = undefined;
|
|
const DoubleTapReactionEmoji = (UserSettingsModule).DoubleTapReactionEmoji;
|
|
const setting = DoubleTapReactionEmoji.getSetting();
|
|
const value4 = null;
|
|
if ((value4 == setting ? value2 : setting.disableDoubleTap) === true) {
|
|
return value4;
|
|
}
|
|
if (value4 == setting) {
|
|
r2 = DoubleTapExpandExperiment.getConfig({location: 'createMessageAccessibilityActions'}).enabled ? intl.formatToPlainString(t.eQIttH,
|
|
|
|
{emojiName: 'heart'}) : value4;
|
|
} else {
|
|
var value5 = (require(8217) /* metro dependency 8217: DoubleTapToReactUtils */).disambiguatedEmojiFromSettingsValue(setting);
|
|
if (value4 != value5) {
|
|
return intl.formatToPlainString(t.eQIttH, {emojiName: value5.name});
|
|
}
|
|
r2 = DoubleTapExpandExperiment.getConfig({location: 'createMessageAccessibilityActions'}).enabled ? intl.formatToPlainString(t.eQIttH,
|
|
|
|
{emojiName: 'heart'}) : value4;
|
|
}
|
|
return r2;
|
|
}
|
|
|
|
function getMessageAccessibilityActionFromLabel(a0) { // fn#65780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8401:988, offset: 0x01bde4f5, size: 334 bytes, params: 2, frame: 18
|
|
const object = {};
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const value2 = Reflect.apply(string, intl, [t.iXAna6]);
|
|
const binding = env0_5;
|
|
const VIEW_PROFILE = binding.VIEW_PROFILE;
|
|
object[value2] = VIEW_PROFILE;
|
|
const value3 = intl.string(t.lfIHs4);
|
|
const ADD_REACTION = binding.ADD_REACTION;
|
|
object[value3] = ADD_REACTION;
|
|
const value4 = intl.string(t['5IEsGx']);
|
|
const REPLY = binding.REPLY;
|
|
object[value4] = REPLY;
|
|
string = intl.string;
|
|
const ChPNkN = t.ChPNkN;
|
|
const value5 = Reflect.apply(string, intl, [ChPNkN]);
|
|
const MESSAGE_ACTIONS_MENU = binding.MESSAGE_ACTIONS_MENU;
|
|
object[value5] = MESSAGE_ACTIONS_MENU;
|
|
const value6 = intl.string(t['5Q9+/L']);
|
|
const EDIT_GDM = binding.EDIT_GDM;
|
|
object[value6] = EDIT_GDM;
|
|
const quickReactionLabel = getQuickReactionLabel();
|
|
if (quickReactionLabel != null) {
|
|
object[quickReactionLabel] = env0_5.ADD_QUICK_REACTION;
|
|
}
|
|
return object[a0];
|
|
}
|
|
|
|
function createMessageAccessibilityActions(a0, a1) { // fn#65781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8401:1437, offset: 0x01bde643, size: 520 bytes, params: 3, frame: 21
|
|
var r2;
|
|
var push;
|
|
var quickReactionLabel;
|
|
if (a1 == null) {
|
|
return [];
|
|
}
|
|
let value = a1.getGuildId();
|
|
const value2 = value != null;
|
|
if (value2) {
|
|
value = GuildVerificationStore.canChatInGuild(value);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value2;
|
|
}
|
|
r2 = r2 && PermissionStore.can(Permissions.ADD_REACTIONS, a1);
|
|
r2 = !r2 ? a1.isPrivate() : r2;
|
|
let object = {};
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
object.label = Reflect.apply(string, intl, [t.iXAna6]);
|
|
const VIEW_PROFILE = env0_5.VIEW_PROFILE;
|
|
object.name = VIEW_PROFILE;
|
|
const items2 = [object];
|
|
if (r2) {
|
|
items2.push({label: intl.string(t.lfIHs4), name: env0_5.ADD_REACTION});
|
|
quickReactionLabel = getQuickReactionLabel();
|
|
if (quickReactionLabel != null) {
|
|
items2.push({label: quickReactionLabel, name: env0_5.ADD_QUICK_REACTION});
|
|
}
|
|
}
|
|
if (CanReplyToMessageModule.canReplyToMessage(a1, a0)) {
|
|
push = items2.push;
|
|
object = {};
|
|
object.label = intl.string(t['5IEsGx']);
|
|
object.name = env0_5.REPLY;
|
|
Reflect.apply(push, items2, [object]);
|
|
}
|
|
push = items2.push;
|
|
string = intl.string;
|
|
const ChPNkN = t.ChPNkN;
|
|
const MESSAGE_ACTIONS_MENU = env0_5.MESSAGE_ACTIONS_MENU;
|
|
Reflect.apply(push, items2, [{label: Reflect.apply(string, intl, [ChPNkN]), name: MESSAGE_ACTIONS_MENU}]);
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun65778, 8216, [4798, 3784, 661, 3829, 8217, 1244, 8220, 8228,
|
|
2]) /* metro module 8216, dependencies: [4798, 3784, 661, 3829, 8217, 1244, 8220, 8228, 2] */;
|