151 lines
7.5 KiB
TypeScript
151 lines
7.5 KiB
TypeScript
/* Metro module 8319; source: modules/messages/VoiceSessionUtils.tsx; dependencies: [31, 5221, 1379, 1878, 8320, 566, 8213, 4634, 1244, 22, 2] */
|
|
function _fun66244(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:6, offset: 0x01bf4d30, size: 201 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = function(a0) {
|
|
return require(dependencyMap[4]).maybeSortByProbability(_fun66246(a0),
|
|
UserAffinitiesV2Store.getUserAffinitiesMap(),
|
|
'VoiceSessionUtils - participants');
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/VoiceSessionUtils.tsx');
|
|
exports.getSortedVoiceSessionParticipants = closure;
|
|
exports.useSortedVoiceSessionParticipants = useSortedVoiceSessionParticipants;
|
|
exports.getVoiceSessionMessageContent = getVoiceSessionMessageContent;
|
|
}
|
|
|
|
function getSortedVoiceSessionParticipants(a0) { // fn#66245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:136, offset: 0x01bf4df9, size: 77 bytes, params: 2, frame: 16
|
|
return (require(8320) /* metro dependency 8320: maybeSortByProbability */).maybeSortByProbability(((a0) => {
|
|
var r0;
|
|
var env0_0 = a0;
|
|
var property = a0.call;
|
|
r0 = property == null ? undefined : property.participants.reduce(_fun66247, []);
|
|
r0 = r0 ?? [];
|
|
return r0;
|
|
})(a0), UserAffinitiesV2Store.getUserAffinitiesMap(), 'VoiceSessionUtils - participants');
|
|
}
|
|
|
|
function useSortedVoiceSessionParticipants(a0) { // fn#66248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:638, offset: 0x01bf4ee6, size: 121 bytes, params: 2, frame: 18
|
|
return env0_3.useMemo(_fun66255, [((a0) => {
|
|
var env0_0 = a0;
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserStore], _fun66250,
|
|
[a0.author.id, a0.call]);
|
|
})(a0), (require(566) /* metro dependency 566: flux */).useStateFromStores([UserAffinitiesV2Store], function() {
|
|
return UserAffinitiesV2Store.getUserAffinitiesMap();
|
|
}, [])]);
|
|
}
|
|
|
|
function getVoiceSessionMessageContent(a0) { // fn#66256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:1125, offset: 0x01bf50af, size: 461 bytes, params: 2, frame: 24
|
|
var nick;
|
|
var r0;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var atbXuX;
|
|
var object2;
|
|
var length;
|
|
const identity = (require(22) /* metro dependency 22 */).identity;
|
|
var property;
|
|
const env0_0 = ChannelStore.getChannel(a0.channel_id);
|
|
const value2 = undefined;
|
|
const value3 = (importDefault(8213) /* metro dependency 8213: getHumanizedCallDuration */)(a0);
|
|
const messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(a0);
|
|
const value6 = getSortedVoiceSessionParticipants(a0).map(_fun66257);
|
|
if (value3 == null) {
|
|
r0 = intl.formatToPlainString(t.HzBfIN, {username: messageAuthor.nick, usernameOnClick: identity});
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
atbXuX = t.atbXuX;
|
|
object2 = {};
|
|
length = value6.length;
|
|
object2.userCount = length + 1;
|
|
nick = messageAuthor.nick;
|
|
object2.username = nick;
|
|
object2.usernameOnClick = identity;
|
|
property = value6[0];
|
|
nick = property == null ? value2 : property.messageAuthor.nick;
|
|
object2.username2 = nick;
|
|
object2.username2OnClick = identity;
|
|
property = value6[1];
|
|
nick = property == null ? value2 : property.messageAuthor.nick;
|
|
object2.username3 = nick;
|
|
object2.username3OnClick = identity;
|
|
length = value6.length;
|
|
object2.otherCount = length - 1;
|
|
object2.duration = value3;
|
|
r0 = Reflect.apply(formatToPlainString, intl, [atbXuX, object2]);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun66246(a0) { // fn#66246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:189, offset: 0x01bf4e46, size: 64 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const call = a0.call;
|
|
let r0 = call == null ? undefined : call.participants.reduce(_fun66247, []);
|
|
r0 = r0 ?? [];
|
|
return r0;
|
|
}
|
|
|
|
function _fun66249(a0) { // fn#66249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:691, offset: 0x01bf4f5f, size: 96 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserStore], _fun66250,
|
|
[a0.author.id, a0.call]);
|
|
}
|
|
|
|
function _fun66255() { // fn#66255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:1009, offset: 0x01bf5076, size: 57 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(8320) /* metro dependency 8320: maybeSortByProbability */;
|
|
return value.maybeSortByProbability(env0_0, env0_1, 'VoiceSessionUtils - participants');
|
|
}
|
|
|
|
function _fun66257(a0) { // fn#66257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:1291, offset: 0x01bf527c, size: 60 bytes, params: 2, frame: 14
|
|
const object2 = {user: a0};
|
|
const value = environment.__proto__;
|
|
object2.messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getUserAuthor(a0, env0_0);
|
|
return object2;
|
|
}
|
|
|
|
function _fun66247(a0, a1) { // fn#66247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:264, offset: 0x01bf4e86, size: 96 bytes, params: 3, frame: 15
|
|
var r0;
|
|
var items2;
|
|
let value = a0;
|
|
const user = UserStore.getUser(a1);
|
|
if (user == null) {
|
|
r0 = value;
|
|
} else if (user.id === env0_0.author.id) {
|
|
r0 = value;
|
|
} else {
|
|
items2 = [];
|
|
value = arraySpread(items2, value, 0, value);
|
|
items2[value] = user;
|
|
value + 1;
|
|
r0 = items2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun66250() { // fn#66250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:731, offset: 0x01bf4fbf, size: 109 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var value;
|
|
if (env0_0.call?.participants != null) {
|
|
value = env0_0.call.participants.map(function(a0) {
|
|
return UserStore.getUser(a0);
|
|
});
|
|
value = value.filter(_fun66252);
|
|
value = value.filter(_fun66253);
|
|
r0 = value;
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun66253({id}) { // fn#66253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8504:868, offset: 0x01bf5043, size: 32 bytes, params: 2, frame: 2
|
|
return id !== env1_0.author.id;
|
|
}
|
|
|