667 lines
28 KiB
TypeScript
667 lines
28 KiB
TypeScript
/* Metro module 4800; source: utils/ChannelUtils.tsx; dependencies: [1383, 1379, 1935, 3784, 1934, 4300, 661, 1880, 3789, 483, 1909, 4801, 4802, 1244, 3995, 4803, 21, 2, 4806] */
|
|
function _fun41574(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#41574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6, offset: 0x01121f4e, size: 646 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_41577 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = allowChannelAccess;
|
|
const closure2 = function({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) {
|
|
channels.forEach(_fun41581);
|
|
return [];
|
|
};
|
|
const closure3 = getChannelPermalink;
|
|
const closure4 = getChannelThreadPermalink;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
|
|
const env0_4 = value.isGuildSelectableChannelType;
|
|
const env0_5 = value.TEXT_CHANNEL_TYPES;
|
|
const env0_6 = value.THREAD_CHANNEL_TYPES;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const ChannelTypes = value.ChannelTypes;
|
|
const env0_13 = value.Permissions;
|
|
const env0_14 = value.GuildFeatures;
|
|
const env0_15 = value.BoostedGuildTiers;
|
|
const env0_16 = value.BITRATE_MAX;
|
|
const env0_17 = value.BITRATE_DEFAULT;
|
|
const env0_18 = value.Routes;
|
|
const env0_19 = value.AnalyticsPages;
|
|
const env0_20 = (require(1880) /* metro dependency 1880: PremiumConstants */).BoostedGuildFeatures;
|
|
const env0_21 = ChannelTypes.GUILD_VOICE;
|
|
const env0_22 = ChannelTypes.GUILD_CATEGORY;
|
|
const env0_23 = ChannelTypes.GUILD_STAGE_VOICE;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ChannelUtils.tsx');
|
|
exports.denyChannelAccessForNonPaidUsers = denyChannelAccessForNonPaidUsers;
|
|
exports.allowChannelAccess = closure;
|
|
exports.permissionOverwritesForRoles = permissionOverwritesForRoles;
|
|
exports.permissionOverwriteForUser = function(a0, a1) {
|
|
var allowChannelAccessBinding = allowChannelAccess;
|
|
var MEMBER = require(dependencyMap[10]).PermissionOverwriteType.MEMBER;
|
|
return allowChannelAccessBinding(a0, a1, MEMBER);
|
|
};
|
|
exports.permissionOverwriteForRole = function(a0, a1) {
|
|
var allowChannelAccessBinding = allowChannelAccess;
|
|
var ROLE = require(dependencyMap[10]).PermissionOverwriteType.ROLE;
|
|
return allowChannelAccessBinding(a0, a1, ROLE);
|
|
};
|
|
exports.permissionOverwritesForAnnouncement = function(a0) {
|
|
var object = {id: a0};
|
|
object.type = require(dependencyMap[10]).PermissionOverwriteType.ROLE;
|
|
object.deny = Permissions.SEND_MESSAGES;
|
|
object.allow = importAll(dependencyMap[8]).NONE;
|
|
return [object];
|
|
};
|
|
exports.isChannelFull = isChannelFull;
|
|
exports.sanitizeGuildTextChannelName = importDefault(4806) /* metro dependency 4806: sanitizeGuildTextChannelName */;
|
|
exports.getBitrateLimit = getBitrateLimit;
|
|
exports.computeSummarizedVoiceStates = closure2;
|
|
exports.computeSummarizedVoiceUsers = computeSummarizedVoiceUsers;
|
|
exports.isAnyVoiceStateStage = isAnyVoiceStateStage;
|
|
exports.channelTypeString = channelTypeString;
|
|
exports.getPrivateChannelUserTagsString = getPrivateChannelUserTagsString;
|
|
exports.getMentionIconType = getMentionIconType;
|
|
exports.previousTextChannelRouteForGuild = function(a0) {
|
|
var r2;
|
|
var value4;
|
|
var value2 = ChannelStore.getChannel(SelectedChannelStore.getLastSelectedChannelId());
|
|
var value3 = null;
|
|
if (value3 == value2) {
|
|
value4 = GuildChannelStore.getDefaultChannel(a0);
|
|
r2 = value3 != value4 ? value4.id : value3;
|
|
} else if (value2.getGuildId() !== a0) {
|
|
value4 = GuildChannelStore.getDefaultChannel(a0);
|
|
r2 = value3 != value4 ? value4.id : value3;
|
|
} else if (value2.type === ChannelTypes.GUILD_TEXT) {
|
|
r2 = value2.id;
|
|
} else {
|
|
value4 = GuildChannelStore.getDefaultChannel(a0);
|
|
r2 = value3 != value4 ? value4.id : value3;
|
|
}
|
|
return Routes.CHANNEL(a0, r2);
|
|
};
|
|
exports.getChannelPermalink = closure3;
|
|
exports.getChannelThreadPermalink = closure4;
|
|
exports.getChannelLinkToCopy = getChannelLinkToCopy;
|
|
exports.getChannelAnalyticsPage = getChannelAnalyticsPage;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_41575(a0, a1) { // fn#41575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:424, offset: 0x011221d4, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun41576;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_41577(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_41577(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_41577(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun41576;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function isTypeOrCategory(a0, a1) { // fn#41578, offset: 0x01122346, size: 26 bytes, params: 3, frame: 3
|
|
return a0 === a1 || a0 === GUILD_CATEGORY;
|
|
}
|
|
|
|
function allowChannelAccess(a0, a1, a2) { // fn#41579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1446, offset: 0x01122360, size: 260 bytes, params: 4, frame: 20
|
|
var r10;
|
|
var moduleValue;
|
|
let NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
if (isGuildSelectableChannelType(a1) || a1 === GUILD_CATEGORY) {
|
|
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
|
|
r10 = moduleValue.add(NONE, Permissions.VIEW_CHANNEL);
|
|
} else {
|
|
r10 = NONE;
|
|
}
|
|
const r1 = isTypeOrCategory(a1, GUILD_VOICE) || isTypeOrCategory(a1,
|
|
GUILD_STAGE_VOICE) ? (importAll(483) /* metro dependency 483: BigFlagUtils */).add((importAll(483) /* metro dependency 483: BigFlagUtils */).add(r10,
|
|
Permissions.VIEW_CHANNEL), Permissions.CONNECT) : r10;
|
|
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
return {id: a0, type: a2, deny: NONE, allow: r1};
|
|
}
|
|
|
|
function computeSummarizedVoiceStates({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) { // fn#41580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1709, offset: 0x01122464, size: 66 bytes, params: 2, frame: 12
|
|
channels.forEach(_fun41581);
|
|
return [];
|
|
}
|
|
|
|
function getChannelPermalink(a0, a1, a2, a3) { // fn#41584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2079, offset: 0x01122576, size: 133 bytes, params: 5, frame: 22
|
|
const value = '';
|
|
return value + global.location.protocol + '//' + global.location.host + Routes.CHANNEL(a0, a1,
|
|
a2) + (a3 == null ? value : '?summaryId=' + a3);
|
|
}
|
|
|
|
function getChannelThreadPermalink(a0, a1, a2, a3) { // fn#41585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2222, offset: 0x011225fb, size: 135 bytes, params: 5, frame: 20
|
|
var r0;
|
|
var location;
|
|
var protocol;
|
|
var host;
|
|
var value;
|
|
if (a0 == null) {
|
|
r0 = getChannelPermalink(a0, a1, a3);
|
|
} else if (a1 == null) {
|
|
r0 = getChannelPermalink(a0, a1, a3);
|
|
} else if (a2 == null) {
|
|
r0 = getChannelPermalink(a0, a1, a3);
|
|
} else {
|
|
location = global.location;
|
|
protocol = location.protocol;
|
|
location = global.location;
|
|
host = location.host;
|
|
value = Routes.CHANNEL_THREAD_VIEW(a0, a1, a2, a3);
|
|
value = '' + protocol + '//' + host + value;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function denyChannelAccessForNonPaidUsers(a0, a1) { // fn#41586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2494, offset: 0x01122682, size: 201 bytes, params: 3, frame: 18
|
|
var NONE;
|
|
var moduleValue;
|
|
var value3;
|
|
var object2;
|
|
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
if (a1 === GUILD_STAGE_VOICE) {
|
|
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
|
|
value3 = moduleValue.add(NONE, Permissions.CONNECT);
|
|
object2 = {id: a0};
|
|
object2.type = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.ROLE;
|
|
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
object2.allow = NONE;
|
|
object2.deny = value3;
|
|
return object2;
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Premium channel feature not supported for channel type ' + a1;
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function permissionOverwritesForRoles(a0, a1, a2) { // fn#41587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2855, offset: 0x0112274b, size: 342 bytes, params: 4, frame: 25
|
|
var r15;
|
|
var r5;
|
|
var push;
|
|
var ROLE;
|
|
var NONE;
|
|
var moduleValue;
|
|
var object2;
|
|
const value = a3;
|
|
const env0_0 = a1;
|
|
const r4 = value !== undefined ? value : false;
|
|
const items2 = [];
|
|
if (a2.length > 0 || r4) {
|
|
push = items2.push;
|
|
ROLE = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.ROLE;
|
|
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
if (isGuildSelectableChannelType(a1) || a1 === GUILD_CATEGORY) {
|
|
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
|
|
r15 = moduleValue.add(NONE, Permissions.VIEW_CHANNEL);
|
|
} else {
|
|
r15 = NONE;
|
|
}
|
|
r5 = isTypeOrCategory(a1,
|
|
GUILD_VOICE) ? (importAll(483) /* metro dependency 483: BigFlagUtils */).add((importAll(483) /* metro dependency 483: BigFlagUtils */).add(r15,
|
|
|
|
Permissions.VIEW_CHANNEL), Permissions.CONNECT) : r15;
|
|
object2 = {id: a0, type: ROLE};
|
|
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
|
|
object2.allow = NONE;
|
|
object2.deny = r5;
|
|
Reflect.apply(push, items2, [object2]);
|
|
}
|
|
a2.forEach(_fun41588);
|
|
return items2;
|
|
}
|
|
|
|
function isChannelFull(a0, a1, a2) { // fn#41592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:3810, offset: 0x011229c1, size: 366 bytes, params: 4, frame: 23
|
|
var r0;
|
|
var r6;
|
|
var r1;
|
|
let value = a0.getGuildId();
|
|
const guild = a2.getGuild(value);
|
|
const value3 = undefined;
|
|
const maxVideoChannelUsers = guild == null ? value3 : guild.maxVideoChannelUsers;
|
|
const value4 = -1;
|
|
const r12 = maxVideoChannelUsers ?? value4;
|
|
const r5 = (guild == null ? value3 : guild.maxStageVideoChannelUsers) ?? value4;
|
|
const value6 = SortedVoiceStateStore.countVoiceStatesForChannel(a0.id);
|
|
const voiceStatesForChannel = SortedVoiceStateStore.getVoiceStatesForChannel(a0);
|
|
const can = PermissionStore.can;
|
|
const MOVE_MEMBERS = Permissions.MOVE_MEMBERS;
|
|
const r2 = Reflect.apply(can, PermissionStore, [MOVE_MEMBERS, a0]) && PermissionStore.can(Permissions.CONNECT, a0);
|
|
if (a0.type === GUILD_STAGE_VOICE) {
|
|
value = value != null;
|
|
if (value) {
|
|
value = a1.hasVideo(a0.id);
|
|
if (value) {
|
|
r6 = value;
|
|
} else {
|
|
value = require(4801) /* metro dependency 4801: ChannelListUtils */;
|
|
value = value.hasStream(voiceStatesForChannel);
|
|
r6 = value;
|
|
}
|
|
r1 = r6;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r1 = r1 && r5 > 0;
|
|
r1 = r1 && value6 >= r5;
|
|
r0 = r1;
|
|
} else {
|
|
value = value != null;
|
|
r0 = value && a1.hasVideo(a0.id);
|
|
r0 = r0 && r12 > 0;
|
|
if (r0) {
|
|
value = 0;
|
|
value = value6 >= r12 + (r2 ? 1 : value);
|
|
r0 = value;
|
|
}
|
|
}
|
|
const userLimit = a0.userLimit;
|
|
r0 = !r0 ? userLimit > 0 && value6 >= a0.userLimit && !r2 : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getBitrateLimit(a0, a1) { // fn#41593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4350, offset: 0x01122b2f, size: 161 bytes, params: 3, frame: 16
|
|
return a1.isGuildStageVoice() ? BITRATE_DEFAULT : a0 == null ? BITRATE_MAX : global.Math.max(a0.features.has(GuildFeatures.VIP_REGIONS) ? BoostedGuildFeatures[BoostedGuildTiers.TIER_3].limits.bitrate : BITRATE_MAX,
|
|
BoostedGuildFeatures[a0.premiumTier].limits.bitrate);
|
|
}
|
|
|
|
function computeSummarizedVoiceUsers({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) { // fn#41594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4615, offset: 0x01122bd0, size: 82 bytes, params: 2, frame: 14
|
|
return computeSummarizedVoiceStates({channels: channels, selectedChannelId: selectedChannelId,
|
|
selectedVoiceChannelId: selectedVoiceChannelId, voiceStates: voiceStates}).map(function(a0) {
|
|
return a0.user;
|
|
});
|
|
}
|
|
|
|
function isAnyVoiceStateStage(a0, a1, a2) { // fn#41596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4876, offset: 0x01122c2c, size: 280 bytes, params: 4, frame: 29
|
|
var r4;
|
|
var r14;
|
|
var value4;
|
|
var id;
|
|
var property;
|
|
var isGuildStageVoice;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var moduleValue;
|
|
var getAudienceRequestToSpeakState;
|
|
var voiceState;
|
|
var value8;
|
|
var RequestToSpeakStates;
|
|
var ON_STAGE;
|
|
var value9;
|
|
var value10;
|
|
const value2 = _createForOfIteratorHelperLoose_41575(a0);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r4 = value3;
|
|
reducibleLoop1: while (true) {
|
|
value4 = r4.value;
|
|
id = value4.id;
|
|
if (id !== a1) {
|
|
id = value4.id;
|
|
property = a2[id];
|
|
reducibleJoin8: while (true) {
|
|
if (property == null) {
|
|
break reducibleJoin8;
|
|
}
|
|
isGuildStageVoice = value4.isGuildStageVoice;
|
|
if (!Reflect.apply(isGuildStageVoice, value4, [])) {
|
|
break reducibleJoin8;
|
|
}
|
|
value5 = _createForOfIteratorHelperLoose_41575(property);
|
|
value6 = value5();
|
|
done = value6.done;
|
|
if (done) {
|
|
break reducibleJoin8;
|
|
}
|
|
r14 = value6;
|
|
reducibleLoop5: while (true) {
|
|
value7 = r14.value;
|
|
moduleValue = require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */;
|
|
getAudienceRequestToSpeakState = moduleValue.getAudienceRequestToSpeakState;
|
|
voiceState = value7.voiceState;
|
|
value8 = Reflect.apply(getAudienceRequestToSpeakState, moduleValue, [voiceState]);
|
|
RequestToSpeakStates = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates;
|
|
ON_STAGE = RequestToSpeakStates.ON_STAGE;
|
|
if (value8 === ON_STAGE) {
|
|
return true;
|
|
}
|
|
value9 = value5();
|
|
done = value9.done;
|
|
if (done) {
|
|
break reducibleJoin8;
|
|
}
|
|
r14 = value9;
|
|
continue reducibleLoop5;
|
|
}
|
|
}
|
|
}
|
|
value10 = value2();
|
|
done = value10.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r4 = value10;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function channelTypeString({type}) { // fn#41597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:5270, offset: 0x01122d44, size: 783 bytes, params: 2, frame: 15
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const DM = ChannelTypes.DM;
|
|
if (DM === type) {
|
|
return intl.string(t.jN2DfZ);
|
|
}
|
|
const GROUP_DM = ChannelTypes.GROUP_DM;
|
|
if (GROUP_DM === type) {
|
|
return intl.string(t['e5y+gm']);
|
|
}
|
|
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
if (GUILD_TEXT === type) {
|
|
return intl.string(t.Pnajj0);
|
|
}
|
|
const GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
if (GUILD_FORUM === type) {
|
|
return intl.string(t.GbryDd);
|
|
}
|
|
const GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
if (GUILD_MEDIA === type) {
|
|
return intl.string(t.seKITE);
|
|
}
|
|
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
if (GUILD_VOICE === type) {
|
|
return intl.string(t.BVZqJl);
|
|
}
|
|
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
|
|
if (GUILD_STAGE_VOICE === type) {
|
|
return intl.string(t.EErMzA);
|
|
}
|
|
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
if (GUILD_ANNOUNCEMENT === type) {
|
|
return intl.string(t.l1dkSD);
|
|
}
|
|
const GUILD_STORE = ChannelTypes.GUILD_STORE;
|
|
if (GUILD_STORE === type) {
|
|
return intl.string(t['P1/Erq']);
|
|
}
|
|
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
if (GUILD_CATEGORY === type) {
|
|
return intl.string(t.vHCZwr);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function getPrivateChannelUserTagsString(a0, a1) { // fn#41598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6063, offset: 0x01123053, size: 298 bytes, params: 3, frame: 20
|
|
var r4;
|
|
var value5;
|
|
var user;
|
|
var value7;
|
|
if (a0 == null) {
|
|
return null;
|
|
}
|
|
const id = a1.getCurrentUser()?.id;
|
|
if (id == null) {
|
|
return null;
|
|
}
|
|
const items2 = [];
|
|
const value3 = _createForOfIteratorHelperLoose_41575(a0);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r4 = value4;
|
|
while (true) {
|
|
value5 = r4.value;
|
|
if (id !== value5) {
|
|
user = a1.getUser(value5);
|
|
if (user == null) {
|
|
break;
|
|
}
|
|
items2.push(user);
|
|
break;
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
if (items2.length === 0) {
|
|
return null;
|
|
}
|
|
const value9 = items2.slice(0, 2).map(_fun41599);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const BXG0Eh = (require(1244) /* metro dependency 1244: indexNative */).t.BXG0Eh;
|
|
return Reflect.apply(formatToPlainString, intl, [BXG0Eh, {users: items2.length, user1: value9[0], user2: value9[1],
|
|
extras: items2.length - value9.length}]);
|
|
}
|
|
|
|
function getMentionIconType(a0) { // fn#41600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6604, offset: 0x011231bc, size: 304 bytes, params: 2, frame: 16
|
|
if (a0 == null) {
|
|
return 'text';
|
|
}
|
|
const isMediaChannel = a0.isMediaChannel();
|
|
const type = a0.type;
|
|
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
return type === GUILD_VOICE ? PermissionStore.can(Permissions.CONNECT,
|
|
a0) ? 'voice' : 'voice-locked' : a0.type === ChannelTypes.GUILD_STAGE_VOICE ? PermissionStore.can(Permissions.CONNECT,
|
|
a0) ? 'stage' : 'stage-locked' : THREAD_CHANNEL_TYPES.has(a0.type) ? a0.isForumPost() ? 'post' : 'thread' : a0.type === ChannelTypes.GUILD_FORUM ? isMediaChannel ? 'media' : 'forum' : a0.type === ChannelTypes.GUILD_MEDIA ? 'media' : TEXT_CHANNEL_TYPES.has(a0.type) ? 'text' : undefined;
|
|
}
|
|
|
|
function getChannelLinkToCopy(a0, a1, a2, a3) { // fn#41602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:7366, offset: 0x0112336b, size: 151 bytes, params: 5, frame: 21
|
|
var r0;
|
|
var id;
|
|
var getChannelThreadPermalinkBinding;
|
|
var id2;
|
|
let value = a3;
|
|
const guildId = a0.getGuildId();
|
|
if (a1 == null) {
|
|
r0 = value ?? getChannelPermalink(guildId, a0.id, a2);
|
|
} else if ((require(4803) /* metro dependency 4803: MediaPostEmbedUtils */).canUseMediaPostEmbed(guildId, a1)) {
|
|
getChannelThreadPermalinkBinding = getChannelThreadPermalink;
|
|
id = a1.id;
|
|
id2 = a0.id;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = getChannelThreadPermalinkBinding(guildId, id, id2, value.castChannelIdAsMessageId(a0.id));
|
|
r0 = value;
|
|
} else {
|
|
r0 = value ?? getChannelPermalink(guildId, a0.id, a2);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getChannelAnalyticsPage(a0) { // fn#41603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:7629, offset: 0x01123402, size: 129 bytes, params: 2, frame: 4
|
|
if (a0 != null) {
|
|
var type = a0.type;
|
|
var GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
if (GUILD_ANNOUNCEMENT === type) {
|
|
return AnalyticsPages.GUILD_CHANNEL;
|
|
}
|
|
var GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
if (GUILD_TEXT === type) {
|
|
return AnalyticsPages.GUILD_CHANNEL;
|
|
}
|
|
var GUILD_FORUM = ChannelTypes.GUILD_FORUM;
|
|
if (GUILD_FORUM === type) {
|
|
return AnalyticsPages.GUILD_CHANNEL;
|
|
}
|
|
var GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
|
|
if (GUILD_MEDIA === type) {
|
|
return AnalyticsPages.GUILD_CHANNEL;
|
|
}
|
|
var GROUP_DM = ChannelTypes.GROUP_DM;
|
|
if (GROUP_DM === type) {
|
|
return AnalyticsPages.DM_CHANNEL;
|
|
}
|
|
var DM = ChannelTypes.DM;
|
|
if (DM === type) {
|
|
return AnalyticsPages.DM_CHANNEL;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function _fun41581(a0) { // fn#41581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1847, offset: 0x011224a6, size: 97 bytes, params: 2, frame: 13
|
|
var property;
|
|
var forEach;
|
|
const id = a0.id;
|
|
var isGuildStageVoice;
|
|
if (id !== selectedVoiceChannelId) {
|
|
if (a0.id !== selectedChannelId) {
|
|
property = voiceStates[a0.id];
|
|
if (property != null) {
|
|
isGuildStageVoice = a0.isGuildStageVoice();
|
|
forEach = property.forEach;
|
|
if (isGuildStageVoice) {
|
|
Reflect.apply(forEach, property, [_fun41582]);
|
|
} else {
|
|
Reflect.apply(forEach, property, [_fun41583]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun41588(a0) { // fn#41588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:3238, offset: 0x011228a1, size: 74 bytes, params: 2, frame: 17
|
|
const binding = env0_1;
|
|
const push = binding.push;
|
|
const allowChannelAccessBinding = allowChannelAccess;
|
|
const PermissionOverwriteType = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType;
|
|
const ROLE = PermissionOverwriteType.ROLE;
|
|
Reflect.apply(push, binding, [allowChannelAccessBinding(a0, require, ROLE)]);
|
|
}
|
|
|
|
function _fun41599(a0) { // fn#41599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6391, offset: 0x0112317d, size: 63 bytes, params: 2, frame: 13
|
|
var r0;
|
|
const isProvisional = a0.isProvisional;
|
|
let value = environment.__proto__;
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
if (isProvisional) {
|
|
value = value.getName(a0);
|
|
r0 = value;
|
|
} else {
|
|
value = value.getUserTag(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun41582(a0) { // fn#41582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1931, offset: 0x01122507, size: 89 bytes, params: 2, frame: 16
|
|
let value = environment.__proto__.__proto__;
|
|
const getAudienceRequestToSpeakState = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).getAudienceRequestToSpeakState;
|
|
value = Reflect.apply(getAudienceRequestToSpeakState, value, [a0.voiceState]);
|
|
const RequestToSpeakStates = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates;
|
|
const ON_STAGE = RequestToSpeakStates.ON_STAGE;
|
|
if (value === ON_STAGE) {
|
|
value = environment.__proto__;
|
|
env1_3.push(a0);
|
|
}
|
|
}
|
|
|
|
function _fun41583(a0) { // fn#41583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2057, offset: 0x01122560, size: 22 bytes, params: 2, frame: 11
|
|
return env1_3.push(a0);
|
|
}
|
|
|