812 lines
34 KiB
TypeScript
812 lines
34 KiB
TypeScript
/* Metro module 12601; source: stores/PrivateChannelRecipientsInviteStore.tsx; dependencies: [6, 7, 15, 17, 18, 4107, 5221, 1383, 1379, 5078, 6586, 1945, 1867, 3793, 1878, 661, 12602, 6592, 1861, 3995, 3829, 7238, 566, 694, 2] */
|
|
function _fun96616(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6, offset: 0x02161b2f, size: 850 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_96622 = 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 reset_96623 = function() {
|
|
env0_21 = '';
|
|
env0_22 = 0;
|
|
env0_23 = [];
|
|
var Set = global.Set;
|
|
var value3 = new Set();
|
|
env0_20 = false;
|
|
env0_27 = null;
|
|
env0_25 = false;
|
|
};
|
|
const setQuery = function(a0) {
|
|
env0_21 = a0;
|
|
env0_22 = 0;
|
|
return performQuery();
|
|
};
|
|
const closure = function({key}) {
|
|
if (key !== NEW_GROUP_DM_POPOUT_ID) {
|
|
return false;
|
|
}
|
|
env0_20 = true;
|
|
updateHasFriends();
|
|
env0_19 = createSearchContext();
|
|
env0_27 = null;
|
|
setQuery('');
|
|
};
|
|
const closure2 = function({key}) {
|
|
if (key !== NEW_GROUP_DM_POPOUT_ID) {
|
|
return false;
|
|
}
|
|
PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE();
|
|
};
|
|
const closure3 = PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const experimentStore = importDefault(4107) /* metro dependency 4107: ExperimentStore */;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const env0_10 = (require(1383) /* metro dependency 1383: ChannelRecord */).PrivateChannelRecord;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const consentStore = importDefault(5078) /* metro dependency 5078: ConsentStore */;
|
|
const frecencyStore = importDefault(6586) /* metro dependency 6586: FrecencyStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_18 = constantsModule.NEW_GROUP_DM_POPOUT_ID;
|
|
constantsModule.Consents;
|
|
let env0_23 = [];
|
|
let Set = global.Set;
|
|
let set = new Set();
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun96649(Store).displayName = 'PrivateChannelRecipientsInviteStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
|
|
reset_96623();
|
|
}, GUILD_MEMBERS_CHUNK_BATCH: GUILD_MEMBERS_CHUNK_BATCH_96658, GUILD_MEMBERS_REQUEST: GUILD_MEMBERS_REQUEST_96659,
|
|
CHANNEL_SELECT: CHANNEL_SELECT_96660, MODAL_PUSH: closure, SHOW_ACTION_SHEET: closure,
|
|
PRIVATE_CHANNEL_RECIPIENTS_INVITE_OPEN: function(a0) {
|
|
env0_20 = true;
|
|
updateHasFriends();
|
|
env0_19 = createSearchContext();
|
|
env0_27 = a0.channelId;
|
|
setQuery('');
|
|
}, MODAL_POP: closure2, HIDE_ACTION_SHEET: closure2, PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE: closure3,
|
|
PRIVATE_CHANNEL_RECIPIENTS_INVITE_QUERY: function(a0) {
|
|
env0_27 = a0.channelId;
|
|
setQuery(a0.query);
|
|
}, PRIVATE_CHANNEL_RECIPIENTS_INVITE_SELECT: function(a0) {
|
|
env0_22 = a0.row;
|
|
}, PRIVATE_CHANNEL_RECIPIENTS_ADD_USER: PRIVATE_CHANNEL_RECIPIENTS_ADD_USER,
|
|
PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER: PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/PrivateChannelRecipientsInviteStore.tsx');
|
|
exports.default = set;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_96617() { // fn#96617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:327, offset: 0x02161e81, 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_96617_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_96620(a0, a1) { // fn#96620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:520, offset: 0x02161ee3, size: 372 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 _fun96621;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_96622(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_96622(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_96622(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun96621;
|
|
}
|
|
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 setLoading(a0) { // fn#96624, offset: 0x021620a4, size: 25 bytes, params: 2, frame: 4
|
|
return env0_25 !== a0 && true;
|
|
}
|
|
|
|
function performQuery() { // fn#96626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1637, offset: 0x021620d9, size: 346 bytes, params: 1, frame: 19
|
|
var r1;
|
|
var r9;
|
|
var channel;
|
|
var binding;
|
|
var currentUser;
|
|
var value4;
|
|
var frictionlessGDMsEnabled;
|
|
var object2;
|
|
var setQuery;
|
|
if (env0_20) {
|
|
channel = ChannelStore.getChannel(env0_27);
|
|
binding = env0_21;
|
|
if (binding.trim().length === 0) {
|
|
if (env0_19 != null) {
|
|
env0_19.clearQuery();
|
|
}
|
|
env0_23 = getDefaultResults(channel);
|
|
setLoading(false);
|
|
return true;
|
|
}
|
|
currentUser = UserStore.getCurrentUser();
|
|
value4 = undefined;
|
|
r1 = currentUser == null ? value4 : currentUser.isStaff();
|
|
r9 = r1 != null && r1;
|
|
frictionlessGDMsEnabled = (require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */).getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
|
|
if (frictionlessGDMsEnabled) {
|
|
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(null, env0_21);
|
|
}
|
|
if (env0_19 != null) {
|
|
binding = env0_19;
|
|
setQuery = binding.setQuery;
|
|
object2 = {query: env0_21};
|
|
object2.filters = frictionlessGDMsEnabled ? value4 : {'friends': true, 'staff': null, 'provisional': false,
|
|
staff: r9};
|
|
object2.blacklist = channel != null ? channel.recipients : [];
|
|
object2.boosters = getUserBoosterMap();
|
|
Reflect.apply(setQuery, binding, [object2]);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function updateHasFriends() { // fn#96636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3111, offset: 0x02162606, size: 48 bytes, params: 1, frame: 11
|
|
if (env0_20) {
|
|
return RelationshipStore.getFriendCount() > 0 !== result;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function sortUserList({user}, {user}) { // fn#96637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3197, offset: 0x02162636, size: 152 bytes, params: 3, frame: 19
|
|
const stringUtilsModule = require(1861) /* metro dependency 1861: StringUtils */;
|
|
let stripDiacritics = stringUtilsModule.stripDiacritics;
|
|
let value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = value.getName(user);
|
|
value = Reflect.apply(stripDiacritics, stringUtilsModule, [value.toLocaleLowerCase()]);
|
|
const localeCompare = value.localeCompare;
|
|
const moduleValue2 = stringUtilsModule;
|
|
stripDiacritics = moduleValue2.stripDiacritics;
|
|
const name = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
return Reflect.apply(localeCompare, value, [Reflect.apply(stripDiacritics, moduleValue2,
|
|
[name.toLocaleLowerCase()])]);
|
|
}
|
|
|
|
function getMutualGuildsWithCurrentUser(a0, a1) { // fn#96638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3390, offset: 0x021626ce, size: 177 bytes, params: 3, frame: 22
|
|
var r3;
|
|
var value5;
|
|
var includes;
|
|
var isMember;
|
|
var guild;
|
|
var value7;
|
|
const RestrictedGuildIds = (require(3829) /* metro dependency 3829: UserSettings */).RestrictedGuildIds;
|
|
const setting = RestrictedGuildIds.getSetting();
|
|
const items2 = [];
|
|
const value3 = _createForOfIteratorHelperLoose_96620(a1);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r3 = value4;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
includes = setting.includes;
|
|
if (!Reflect.apply(includes, setting, [value5])) {
|
|
isMember = GuildMemberStore.isMember;
|
|
if (Reflect.apply(isMember, GuildMemberStore, [value5, a0])) {
|
|
guild = GuildStore.getGuild(value5);
|
|
if (guild == null) {
|
|
break;
|
|
}
|
|
items2.push(guild);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function parseUserResults({results}) { // fn#96639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3646, offset: 0x0216277f, size: 565 bytes, params: 2, frame: 30
|
|
var r9;
|
|
var r6;
|
|
var getCurrentUser;
|
|
var value2;
|
|
var moduleValue;
|
|
var getFrictionlessGDMsEnabled;
|
|
var value3;
|
|
var value4;
|
|
var Set;
|
|
var getGuildIds;
|
|
var value5;
|
|
var prototype;
|
|
var value6;
|
|
var set;
|
|
var value7;
|
|
var items2;
|
|
var value8;
|
|
var value9;
|
|
var done;
|
|
var value10;
|
|
var id;
|
|
var comparator;
|
|
var id2;
|
|
var getUser;
|
|
var value11;
|
|
var isProvisional;
|
|
var bot;
|
|
var isStaff;
|
|
var object2;
|
|
var isFriend;
|
|
var getMutualGuildsWithCurrentUserBinding;
|
|
var mutualGuildsWithCurrentUserBinding;
|
|
var length;
|
|
var push;
|
|
var value13;
|
|
var binding;
|
|
var emitChange;
|
|
reducibleJoin25: while (true) {
|
|
if (env0_20) {
|
|
if (env0_21 === '') {
|
|
break reducibleJoin25;
|
|
}
|
|
getCurrentUser = UserStore.getCurrentUser;
|
|
value2 = Reflect.apply(getCurrentUser, UserStore, []);
|
|
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
|
|
getFrictionlessGDMsEnabled = moduleValue.getFrictionlessGDMsEnabled;
|
|
value3 = Reflect.apply(getFrictionlessGDMsEnabled, moduleValue, ['PrivateChannelRecipientsInviteStore']);
|
|
value4 = null;
|
|
reducibleJoin4: while (true) {
|
|
if (value3) {
|
|
Set = global.Set;
|
|
getGuildIds = GuildStore.getGuildIds;
|
|
value5 = Reflect.apply(getGuildIds, GuildStore, []);
|
|
prototype = Set.prototype;
|
|
value6 = Object.create(prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
value7 = set instanceof Object ? set : value6;
|
|
r9 = value7;
|
|
break reducibleJoin4;
|
|
}
|
|
r9 = value4;
|
|
break reducibleJoin4;
|
|
}
|
|
items2 = [];
|
|
value8 = _createForOfIteratorHelperLoose_96620(results);
|
|
value9 = value8();
|
|
done = value9.done;
|
|
if (!done) {
|
|
r6 = value9;
|
|
reducibleLoop5: while (true) {
|
|
value10 = r6.value;
|
|
id = value10.id;
|
|
comparator = value10.comparator;
|
|
reducibleJoin23: while (true) {
|
|
reducibleJoin7: while (true) {
|
|
if (value4 == value2) {
|
|
break reducibleJoin7;
|
|
}
|
|
id2 = value2.id;
|
|
if (id === id2) {
|
|
break reducibleJoin23;
|
|
}
|
|
break reducibleJoin7;
|
|
}
|
|
getUser = UserStore.getUser;
|
|
value11 = Reflect.apply(getUser, UserStore, [id]);
|
|
if (value4 == value11) {
|
|
break reducibleJoin23;
|
|
}
|
|
isProvisional = value11.isProvisional;
|
|
if (isProvisional) {
|
|
break reducibleJoin23;
|
|
}
|
|
bot = value11.bot;
|
|
if (bot) {
|
|
isStaff = value11.isStaff;
|
|
if (!Reflect.apply(isStaff, value11, [])) {
|
|
break reducibleJoin23;
|
|
}
|
|
if (value4 == value2) {
|
|
break reducibleJoin23;
|
|
}
|
|
isStaff = value2.isStaff;
|
|
if (!Reflect.apply(isStaff, value2, [])) {
|
|
break reducibleJoin23;
|
|
}
|
|
}
|
|
object2 = {user: value11, comparator: comparator};
|
|
if (value3) {
|
|
if (value4 != r9) {
|
|
isFriend = RelationshipStore.isFriend;
|
|
id = value11.id;
|
|
if (!Reflect.apply(isFriend, RelationshipStore, [id])) {
|
|
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
|
|
id = value11.id;
|
|
mutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUserBinding(id, r9);
|
|
length = mutualGuildsWithCurrentUserBinding.length;
|
|
if (length === 0) {
|
|
isStaff = value11.isStaff;
|
|
if (!Reflect.apply(isStaff, value11, [])) {
|
|
break reducibleJoin23;
|
|
}
|
|
if (value4 == value2) {
|
|
break reducibleJoin23;
|
|
}
|
|
isStaff = value2.isStaff;
|
|
if (!Reflect.apply(isStaff, value2, [])) {
|
|
break reducibleJoin23;
|
|
}
|
|
}
|
|
length = mutualGuildsWithCurrentUserBinding.length;
|
|
reducibleJoin22: while (true) {
|
|
if (length > 0) {
|
|
object2.mutualGuilds = mutualGuildsWithCurrentUserBinding;
|
|
break reducibleJoin22;
|
|
}
|
|
break reducibleJoin22;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [object2]);
|
|
break reducibleJoin23;
|
|
}
|
|
value13 = value8();
|
|
done = value13.done;
|
|
if (done) {
|
|
break reducibleLoop5;
|
|
}
|
|
r6 = value13;
|
|
continue reducibleLoop5;
|
|
}
|
|
}
|
|
env0_23 = items2;
|
|
binding = env0_28;
|
|
emitChange = binding.emitChange;
|
|
Reflect.apply(emitChange, binding, []);
|
|
break reducibleJoin25;
|
|
}
|
|
break reducibleJoin25;
|
|
}
|
|
}
|
|
|
|
function getUserBoosterMap() { // fn#96640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4285, offset: 0x021629b4, size: 121 bytes, params: 1, frame: 17
|
|
let value = FrecencyStore.getFrequentlyWithoutFetchingLatest();
|
|
value = value.filter(_fun96641);
|
|
const Math = global.Math;
|
|
const max = Math.max;
|
|
const value2 = value.map(function({id}) {
|
|
return FrecencyStore.getScoreWithoutFetchingLatest(id);
|
|
});
|
|
const items = [];
|
|
arraySpread(items, value2, 0, undefined);
|
|
const env0_0 = apply(max, items, Math, undefined);
|
|
value.forEach(_fun96643);
|
|
return {};
|
|
}
|
|
|
|
function createSearchContext() { // fn#96644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4633, offset: 0x02162af2, size: 77 bytes, params: 1, frame: 13
|
|
if (env0_19 != null) {
|
|
env0_19.destroy();
|
|
}
|
|
return (importDefault(7238) /* metro dependency 7238: UserSearchManager */).getUserSearchContext(parseUserResults,
|
|
1000);
|
|
}
|
|
|
|
function PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE() { // fn#96647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4955, offset: 0x02162baa, size: 43 bytes, params: 1, frame: 11
|
|
if (env0_19 != null) {
|
|
env0_19.destroy();
|
|
}
|
|
reset_96623();
|
|
}
|
|
|
|
function performQueryOnAffinityChange() { // fn#96648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5016, offset: 0x02162bd5, size: 73 bytes, params: 1, frame: 13
|
|
var r2;
|
|
var moduleValue;
|
|
const binding = env0_20;
|
|
if (binding) {
|
|
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
|
|
r2 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
|
|
} else {
|
|
r2 = !binding;
|
|
}
|
|
return !r2 && performQuery();
|
|
}
|
|
|
|
function _fun96649(a0) { // fn#96649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5168, offset: 0x02162c1e, size: 201 bytes, params: 2, frame: 16
|
|
const closure = PrivateChannelRecipientsInviteStoreClass;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: value_96651}, {key: 'getResults', value: value_96652},
|
|
{key: 'hasFriends', value: value_96653}, {key: 'getSelectedUsers', value: value_96654}, {key: 'getQuery',
|
|
value: value_96655}, {key: 'getState', value: value_96656}]);
|
|
}
|
|
|
|
function GUILD_MEMBERS_CHUNK_BATCH_96658() { // fn#96658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6241, offset: 0x02162dce, size: 76 bytes, params: 1, frame: 13
|
|
var r2;
|
|
var moduleValue;
|
|
const binding = env0_20;
|
|
if (binding) {
|
|
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
|
|
r2 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
|
|
} else {
|
|
r2 = !binding;
|
|
}
|
|
return !r2 && setLoading(false);
|
|
}
|
|
|
|
function GUILD_MEMBERS_REQUEST_96659({query}) { // fn#96659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6410, offset: 0x02162e1a, size: 109 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var moduleValue;
|
|
const binding = env0_20;
|
|
if (binding) {
|
|
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
|
|
r1 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
|
|
} else {
|
|
r1 = !binding;
|
|
}
|
|
return !r1 && (query === env0_21.toLocaleLowerCase() && setLoading(true));
|
|
}
|
|
|
|
function CHANNEL_SELECT_96660({guildId, channelId}) { // fn#96660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6607, offset: 0x02162e87, size: 58 bytes, params: 2, frame: 12
|
|
if (guildId != null) {
|
|
return false;
|
|
}
|
|
reset_96623();
|
|
return performQuery();
|
|
}
|
|
|
|
function PRIVATE_CHANNEL_RECIPIENTS_ADD_USER({userId}) { // fn#96664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:7293, offset: 0x02162f31, size: 65 bytes, params: 2, frame: 12
|
|
env0_26.add(userId);
|
|
const Set = global.Set;
|
|
const set = new Set(env0_26);
|
|
}
|
|
|
|
function PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER({userId}) { // fn#96665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:7390, offset: 0x02162f72, size: 65 bytes, params: 2, frame: 12
|
|
env0_26.delete(userId);
|
|
const Set = global.Set;
|
|
const set = new Set(env0_26);
|
|
}
|
|
|
|
function getDefaultResults(a0) { // fn#96627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1760, owner: performQuery.getDefaultResults, offset: 0x02162233, size: 533 bytes, params: 2, frame: 23
|
|
var r12;
|
|
var r8;
|
|
var r5;
|
|
var value6;
|
|
var Array;
|
|
var from;
|
|
var Set;
|
|
var items2;
|
|
var prototype;
|
|
var value7;
|
|
var set;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var value17;
|
|
var value18;
|
|
const env0_0 = a0;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const frictionlessGDMsEnabled = (require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */).getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
|
|
const friendIDs = RelationshipStore.getFriendIDs();
|
|
let items3 = [];
|
|
arraySpread(items3, friendIDs, 0, r12);
|
|
if (currentUser == null) {
|
|
r8 = items3;
|
|
} else if (currentUser.isStaff()) {
|
|
value6 = UserStore.filter(_fun96628, false).map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
Set = global.Set;
|
|
items2 = [];
|
|
arraySpread(items2, value6, arraySpread(items2, items3, 0, value6), value6);
|
|
value7 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
r8 = Reflect.apply(from, Array, [set instanceof Object ? set : value7]);
|
|
r12 = value6;
|
|
} else {
|
|
r8 = items3;
|
|
}
|
|
if (frictionlessGDMsEnabled) {
|
|
Set = global.Set;
|
|
value10 = GuildStore.getGuildIds();
|
|
prototype = Set.prototype;
|
|
value11 = Object.create(prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
value12 = set instanceof Object ? set : value11;
|
|
value17 = UserAffinitiesV2Store.getUserAffinities().map(function(a0) {
|
|
return a0.otherUserId;
|
|
}).filter(_fun96631).filter(_fun96632).filter(_fun96633);
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
Set = global.Set;
|
|
items3 = [];
|
|
arraySpread(items3, value17, arraySpread(items3, r8, 0, r12), r12);
|
|
prototype = Set.prototype;
|
|
value18 = Object.create(prototype, {constructor: {value: Set}});
|
|
set = new Set(items3);
|
|
r5 = Reflect.apply(from, Array, [set instanceof Object ? set : value18]);
|
|
} else {
|
|
r5 = r8;
|
|
}
|
|
const value23 = (a0 != null && a0.isGroupDM() ? r5.filter(_fun96634) : r5).reduce(_fun96635, []);
|
|
return value23.sort(sortUserList);
|
|
}
|
|
|
|
function _fun96641(a0) { // fn#96641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4367, offset: 0x02162a2d, size: 29 bytes, params: 2, frame: 10
|
|
const value = environment.__proto__;
|
|
return a0 instanceof PrivateChannelRecord && a0.isDM();
|
|
}
|
|
|
|
function _fun96643(a0) { // fn#96643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4489, offset: 0x02162a66, size: 140 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
const scoreWithoutFetchingLatest = FrecencyStore.getScoreWithoutFetchingLatest(a0.id);
|
|
const recipientId = a0.getRecipientId();
|
|
const isFriend2 = RelationshipStore.isFriend(recipientId);
|
|
const value4 = 0;
|
|
env0_1[recipientId] = 1 + scoreWithoutFetchingLatest / env0_0 + (isFriend2 ? 0.2 : value4) + (ChannelStore.getDMFromUserId(recipientId) != null ? 0.1 : value4);
|
|
}
|
|
|
|
function value_96651() { // fn#96651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5598, offset: 0x02162ce7, size: 151 bytes, params: 1, frame: 28
|
|
this.waitFor(ChannelStore, ConsentStore, ExperimentStore, FrecencyStore, GuildMemberStore, GuildStore,
|
|
RelationshipStore, UserAffinitiesV2Store, UserStore);
|
|
this.syncWith([UserStore, ChannelStore], performQuery);
|
|
this.syncWith([UserAffinitiesV2Store], performQueryOnAffinityChange);
|
|
this.syncWith([RelationshipStore], updateHasFriends);
|
|
}
|
|
|
|
function value_96656() { // fn#96656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5971, offset: 0x02162d7e, size: 65 bytes, params: 1, frame: 3
|
|
return {query: env1_21, selectedRow: env1_22, selectedUsers: env1_26, results: env1_23, hasFriends: env1_24,
|
|
isLoading: env1_25};
|
|
}
|
|
|
|
function _fun96628(a0) { // fn#96628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1958, offset: 0x02162448, size: 39 bytes, params: 2, frame: 10
|
|
return a0.isStaff() && a0.id !== env0_1.id;
|
|
}
|
|
|
|
function _fun96631(a0) { // fn#96631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2145, offset: 0x0216246f, size: 36 bytes, params: 2, frame: 3
|
|
return a0 !== env0_1?.id;
|
|
}
|
|
|
|
function _fun96632(a0) { // fn#96632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2184, offset: 0x02162493, size: 26 bytes, params: 2, frame: 11
|
|
return !RelationshipStore.isBlockedOrIgnored(a0);
|
|
}
|
|
|
|
function _fun96633(a0) { // fn#96633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2222, offset: 0x021624ad, size: 26 bytes, params: 2, frame: 11
|
|
return !RelationshipStore.isFriend(a0);
|
|
}
|
|
|
|
function _fun96634(a0) { // fn#96634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2314, offset: 0x021624c7, size: 31 bytes, params: 2, frame: 11
|
|
const recipients = env0_0.recipients;
|
|
return !recipients.includes(a0);
|
|
}
|
|
|
|
function _fun96635(a0, a1) { // fn#96635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2362, offset: 0x021624e6, size: 288 bytes, params: 3, frame: 19
|
|
var binding;
|
|
var object2;
|
|
var isFriend;
|
|
var id;
|
|
var getMutualGuildsWithCurrentUserBinding;
|
|
let value = environment.__proto__.__proto__;
|
|
const user = UserStore.getUser(a1);
|
|
if (user != null) {
|
|
if (user.isProvisional) {
|
|
return a0;
|
|
}
|
|
if (user.bot) {
|
|
if (user.isStaff()) {
|
|
if (env0_1 == null) {
|
|
return a0;
|
|
}
|
|
binding = env0_1;
|
|
if (binding.isStaff()) {
|
|
object2 = {user: user};
|
|
object2.comparator = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
if (env0_2) {
|
|
if (env0_3 == null) {
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
isFriend = RelationshipStore.isFriend;
|
|
id = user.id;
|
|
if (Reflect.apply(isFriend, RelationshipStore, [id])) {
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
|
|
id = user.id;
|
|
value = getMutualGuildsWithCurrentUserBinding(id, env0_3);
|
|
if (value.length !== 0) {
|
|
if (value.length > 0) {
|
|
object2.mutualGuilds = value;
|
|
}
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
if (user.isStaff()) {
|
|
if (env0_1 == null) {
|
|
return a0;
|
|
}
|
|
binding = env0_1;
|
|
if (binding.isStaff()) {
|
|
if (value.length > 0) {
|
|
object2.mutualGuilds = value;
|
|
}
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
object2 = {user: user};
|
|
object2.comparator = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
|
|
if (env0_2) {
|
|
if (env0_3 == null) {
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
isFriend = RelationshipStore.isFriend;
|
|
id = user.id;
|
|
if (Reflect.apply(isFriend, RelationshipStore, [id])) {
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
|
|
id = user.id;
|
|
value = getMutualGuildsWithCurrentUserBinding(id, env0_3);
|
|
if (value.length !== 0) {
|
|
if (value.length > 0) {
|
|
object2.mutualGuilds = value;
|
|
}
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
if (user.isStaff()) {
|
|
if (env0_1 == null) {
|
|
return a0;
|
|
}
|
|
binding = env0_1;
|
|
if (binding.isStaff()) {
|
|
if (value.length > 0) {
|
|
object2.mutualGuilds = value;
|
|
}
|
|
a0.push(object2);
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
return a0;
|
|
}
|
|
a0.push(object2);
|
|
}
|
|
return a0;
|
|
}
|
|
|