Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,298 @@
|
||||
/* Metro module 7157; source: modules/forums/tracking/TrackingUtils.tsx; dependencies: [4790, 3786, 7158, 6898, 1379, 4645, 3784, 4644, 6865, 661, 1386, 1243, 7159, 1388, 7160, 21, 7161, 2] */
|
||||
function _fun57405(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:6, offset: 0x013e5341, size: 456 bytes, params: 8, frame: 22
|
||||
const env0_0 = require;
|
||||
const closure = getForumChannelSessionId;
|
||||
const closure2 = getForumPostAttachmentMimetypes;
|
||||
const closure3 = collectForumAnalyticsMetadata;
|
||||
let Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
|
||||
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
|
||||
const threadMembersStore = importDefault(7158) /* metro dependency 7158: ThreadMembersStore */;
|
||||
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
|
||||
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
||||
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
|
||||
const env0_9 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
|
||||
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
||||
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
|
||||
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
|
||||
const env0_13 = (require(661) /* metro dependency 661: Constants */).Permissions;
|
||||
const env0_14 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
|
||||
const env0_15 = (require(1243) /* metro dependency 1243: ThreadConstants */).ThreadSortOrderReadableForAnalytics;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/TrackingUtils.tsx');
|
||||
exports.getForumChannelSessionId = closure;
|
||||
exports.convertSortOrderToReadableString = convertSortOrderToReadableString;
|
||||
exports.getForumPostDraftNumAttachments = function(a0) {
|
||||
return UploadAttachmentStore.getUploads(a0, DraftType.FirstThreadMessage).length;
|
||||
};
|
||||
exports.getForumPostDraftAppliedTagIds = getForumPostDraftAppliedTagIds;
|
||||
exports.getNumActiveThreads = function(a0, a1) {
|
||||
var Object = global.Object;
|
||||
return Object.keys(ActiveThreadsStore.getThreadsForParent(a0, a1)).length;
|
||||
};
|
||||
exports.getForumPostAttachmentMimetypes = closure2;
|
||||
exports.collectForumAnalyticsMetadata = closure3;
|
||||
exports.collectForumPostAnalyticsMetadata = collectForumPostAnalyticsMetadata;
|
||||
}
|
||||
|
||||
function getForumChannelSessionId(a0) { // fn#57406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:299, offset: 0x013e5509, size: 41 bytes, params: 2, frame: 11
|
||||
return (importDefault(7159) /* metro dependency 7159: ForumSessionAnalyticsManager */).getForumChannelSessionId(a0);
|
||||
}
|
||||
|
||||
function getForumPostFirstMessage(a0) { // fn#57407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:380, offset: 0x013e5532, size: 43 bytes, params: 2, frame: 11
|
||||
const message = ForumPostMessagesStore.getMessage(a0);
|
||||
return message.loaded ? message.firstMessage : null;
|
||||
}
|
||||
|
||||
function getForumPostUniqueReactionCount(a0) { // fn#57408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:483, offset: 0x013e555d, size: 41 bytes, params: 2, frame: 11
|
||||
const forumPostFirstMessage = getForumPostFirstMessage(a0);
|
||||
return forumPostFirstMessage == null ? 0 : forumPostFirstMessage.reactions.length;
|
||||
}
|
||||
|
||||
function getForumPostReactionCount(a0) { // fn#57409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:597, offset: 0x013e5586, size: 57 bytes, params: 2, frame: 14
|
||||
var r0;
|
||||
let value = getForumPostFirstMessage(a0);
|
||||
const value2 = 0;
|
||||
if (value == null) {
|
||||
r0 = value2;
|
||||
} else {
|
||||
value = value.reactions.reduce(function(a0, a1) {
|
||||
return a0 + a1.count;
|
||||
}, value2);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function getForumPostAppliedTagIds(a0) { // fn#57411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:727, offset: 0x013e55bf, size: 173 bytes, params: 2, frame: 16
|
||||
const channel = ChannelStore.getChannel(a0);
|
||||
if (channel == null) {
|
||||
return [];
|
||||
}
|
||||
let value = ChannelStore.getChannel(channel.parent_id);
|
||||
const value3 = undefined;
|
||||
const availableTags = value == null ? value3 : value.availableTags;
|
||||
if (value == null) {
|
||||
return [];
|
||||
}
|
||||
if (availableTags == null) {
|
||||
return [];
|
||||
}
|
||||
const Set = global.Set;
|
||||
value = availableTags.map(function(a0) {
|
||||
return a0.id;
|
||||
});
|
||||
const set = new Set();
|
||||
const appliedTags = channel.appliedTags;
|
||||
let r0 = appliedTags == null ? value3 : appliedTags.filter(_fun57413);
|
||||
r0 = r0 ?? [];
|
||||
return r0;
|
||||
}
|
||||
|
||||
function getForumPostAttachmentMimetypes(a0) { // fn#57414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:1014, offset: 0x013e566c, size: 54 bytes, params: 2, frame: 11
|
||||
var r0;
|
||||
let value = getForumPostFirstMessage(a0);
|
||||
if (value == null) {
|
||||
r0 = [];
|
||||
} else {
|
||||
value = value.attachments.map(function({content_type}) {
|
||||
return content_type ?? 'unknown';
|
||||
});
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function collectForumAnalyticsMetadata({channelId, sessionId}) { // fn#57416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:1186, offset: 0x013e56bd, size: 492 bytes, params: 2, frame: 21
|
||||
var r6;
|
||||
var r0;
|
||||
var object2;
|
||||
var defaultReactionEmoji;
|
||||
var value6;
|
||||
var availableTags;
|
||||
var defaultImport2;
|
||||
var getSortOrderAnalytics;
|
||||
var id;
|
||||
var getLayoutAnalytics;
|
||||
var getTagSettingAnalytics;
|
||||
var value;
|
||||
const channel = ChannelStore.getChannel(channelId);
|
||||
if (channel != null) {
|
||||
if (channel.isForumLikeChannel()) {
|
||||
object2 = {};
|
||||
object2.forum_channel_has_guidelines = channel.topic != null && channel.topic.trim().length > 0;
|
||||
defaultReactionEmoji = channel.defaultReactionEmoji;
|
||||
value6 = undefined;
|
||||
object2.forum_channel_default_emoji_reaction_id = defaultReactionEmoji == null ? value6 : defaultReactionEmoji.emojiId;
|
||||
defaultReactionEmoji = channel.defaultReactionEmoji;
|
||||
object2.forum_channel_default_emoji_reaction_name = defaultReactionEmoji == null ? value6 : defaultReactionEmoji.emojiName;
|
||||
availableTags = channel.availableTags;
|
||||
r6 = availableTags == null ? value6 : availableTags.map(function(a0) {
|
||||
return a0.id;
|
||||
});
|
||||
r6 = r6 ?? [];
|
||||
object2.forum_channel_available_tag_ids = r6;
|
||||
object2.forum_channel_tag_required = channel.hasFlag(ChannelFlags.REQUIRE_TAG);
|
||||
object2.forum_channel_can_create_post = PermissionStore.can(Permissions.SEND_MESSAGES, channel);
|
||||
object2.forum_channel_filter_tag_ids = (importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).getFilterTagIdsAnalytics();
|
||||
defaultImport2 = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
|
||||
getSortOrderAnalytics = defaultImport2.getSortOrderAnalytics;
|
||||
id = channel.id;
|
||||
object2.forum_channel_sort_order = Reflect.apply(getSortOrderAnalytics, defaultImport2, [id]);
|
||||
object2.forum_channel_session_id = sessionId ?? getForumChannelSessionId(channel.id);
|
||||
value = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
|
||||
getLayoutAnalytics = value.getLayoutAnalytics;
|
||||
id = channel.id;
|
||||
object2.forum_channel_layout = Reflect.apply(getLayoutAnalytics, value, [id]);
|
||||
object2.forum_channel_default_sort_order = channel.defaultSortOrder;
|
||||
value = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
|
||||
getTagSettingAnalytics = value.getTagSettingAnalytics;
|
||||
id = channel.id;
|
||||
object2.forum_channel_tag_setting = Reflect.apply(getTagSettingAnalytics, value, [id]);
|
||||
object2.forum_channel_default_layout = channel.defaultForumLayout;
|
||||
object2.forum_channel_is_moderator_report_channel = channel.isModeratorReportChannel();
|
||||
r0 = object2;
|
||||
} else {
|
||||
r0 = null;
|
||||
}
|
||||
} else {
|
||||
r0 = null;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function convertSortOrderToReadableString(a0) { // fn#57418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:2432, offset: 0x013e58a9, size: 153 bytes, params: 2, frame: 14
|
||||
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
|
||||
const CREATION_DATE = ThreadSortOrder.CREATION_DATE;
|
||||
if (CREATION_DATE === a0) {
|
||||
return ThreadSortOrderReadableForAnalytics.CREATION_DATE;
|
||||
}
|
||||
const LATEST_ACTIVITY = ThreadSortOrder.LATEST_ACTIVITY;
|
||||
if (LATEST_ACTIVITY === a0) {
|
||||
return ThreadSortOrderReadableForAnalytics.LATEST_ACTIVITY;
|
||||
}
|
||||
const Error = global.Error;
|
||||
const value = 'Unexpected sort order ' + a0;
|
||||
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
||||
const error = new Error();
|
||||
throw error instanceof Object ? error : value2;
|
||||
}
|
||||
|
||||
function getForumPostDraftAppliedTagIds(a0) { // fn#57420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:2844, offset: 0x013e5969, size: 234 bytes, params: 2, frame: 16
|
||||
const channel = ChannelStore.getChannel(a0);
|
||||
if (channel == null) {
|
||||
return [];
|
||||
}
|
||||
const channel2 = ChannelStore.getChannel(channel.parent_id);
|
||||
const value4 = undefined;
|
||||
const availableTags = channel2 == null ? value4 : channel2.availableTags;
|
||||
if (channel2 == null) {
|
||||
return [];
|
||||
}
|
||||
if (availableTags == null) {
|
||||
return [];
|
||||
}
|
||||
let value = DraftStore.getThreadSettings(a0);
|
||||
const r3 = (value == null ? value4 : value.appliedTags) ?? new global.Set();
|
||||
const Set = global.Set;
|
||||
value = availableTags.map(function(a0) {
|
||||
return a0.id;
|
||||
});
|
||||
const set = new Set();
|
||||
const Array = global.Array;
|
||||
return Array.from(r3).filter(_fun57422);
|
||||
}
|
||||
|
||||
function collectForumPostAnalyticsMetadata({channelId, sessionId}) { // fn#57424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:3454, offset: 0x013e5a85, size: 695 bytes, params: 2, frame: 21
|
||||
var locked;
|
||||
var r7;
|
||||
var r1;
|
||||
var value4;
|
||||
var object2;
|
||||
var collectForumAnalyticsMetadataBinding;
|
||||
var id;
|
||||
var value5;
|
||||
var threadMetadata;
|
||||
var defaultImport2;
|
||||
var castChannelIdAsMessageId;
|
||||
var getForumPostReactionCountBinding;
|
||||
var getForumPostUniqueReactionCountBinding;
|
||||
var getForumPostAppliedTagIdsBinding;
|
||||
var defaultImport3;
|
||||
var getReadStateSnapshotAnalytics;
|
||||
var value15;
|
||||
var defaultImport4;
|
||||
var value16;
|
||||
var hasJoined;
|
||||
var getForumPostAttachmentMimetypesBinding;
|
||||
const channel = ChannelStore.getChannel(channelId);
|
||||
if (channel != null) {
|
||||
if (channel.isForumPost()) {
|
||||
value4 = ChannelStore.getChannel(channel.parent_id);
|
||||
if (value4 != null) {
|
||||
if (value4.isForumLikeChannel()) {
|
||||
object2 = {};
|
||||
collectForumAnalyticsMetadataBinding = collectForumAnalyticsMetadata;
|
||||
id = value4.id;
|
||||
value5 = undefined;
|
||||
copyDataProperties(object2, collectForumAnalyticsMetadataBinding({channelId: id,
|
||||
sessionId: sessionId}),
|
||||
channelId);
|
||||
object2['thread_approximate_member_count'] = ThreadMembersStore.getMemberCount(channelId);
|
||||
object2['thread_approximate_message_count'] = ThreadMessageStore.getCount(channelId);
|
||||
threadMetadata = channel.threadMetadata;
|
||||
object2['thread_archived'] = (threadMetadata == null ? value5 : threadMetadata.archived) === true;
|
||||
threadMetadata = channel.threadMetadata;
|
||||
locked = threadMetadata == null ? value5 : threadMetadata.locked;
|
||||
r7 = locked != null && locked;
|
||||
object2['thread_locked'] = r7;
|
||||
threadMetadata = channel.threadMetadata;
|
||||
r7 = (threadMetadata == null ? value5 : threadMetadata.autoArchiveDuration) ?? 0;
|
||||
object2['thread_auto_archive_duration_minutes'] = r7;
|
||||
object2['thread_approximate_creation_date'] = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(channelId);
|
||||
id = channel.id;
|
||||
object2['forum_post_id'] = id;
|
||||
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
||||
castChannelIdAsMessageId = defaultImport2.castChannelIdAsMessageId;
|
||||
id = channel.id;
|
||||
object2['forum_post_first_message_id'] = Reflect.apply(castChannelIdAsMessageId, defaultImport2,
|
||||
[id]);
|
||||
getForumPostReactionCountBinding = getForumPostReactionCount;
|
||||
id = channel.id;
|
||||
object2['forum_post_num_reactions'] = getForumPostReactionCountBinding(id);
|
||||
getForumPostUniqueReactionCountBinding = getForumPostUniqueReactionCount;
|
||||
id = channel.id;
|
||||
object2['forum_post_num_unique_reactions'] = getForumPostUniqueReactionCountBinding(id);
|
||||
getForumPostAppliedTagIdsBinding = getForumPostAppliedTagIds;
|
||||
id = channel.id;
|
||||
object2['forum_post_applied_tag_ids'] = getForumPostAppliedTagIdsBinding(id);
|
||||
object2['forum_post_is_pinned'] = channel.hasFlag(ChannelFlags.PINNED);
|
||||
defaultImport3 = importDefault(7161) /* metro dependency 7161: ForumPostAnalyticsManager */;
|
||||
getReadStateSnapshotAnalytics = defaultImport3.getReadStateSnapshotAnalytics;
|
||||
id = channel.id;
|
||||
value15 = Reflect.apply(getReadStateSnapshotAnalytics, defaultImport3, [id]);
|
||||
object2['forum_post_is_new'] = value15 == null ? value5 : value15.isNew;
|
||||
defaultImport4 = importDefault(7161) /* metro dependency 7161: ForumPostAnalyticsManager */;
|
||||
getReadStateSnapshotAnalytics = defaultImport4.getReadStateSnapshotAnalytics;
|
||||
id = channel.id;
|
||||
value16 = Reflect.apply(getReadStateSnapshotAnalytics, defaultImport4, [id]);
|
||||
object2['forum_post_is_unread'] = value16 == null ? value5 : value16.hasUnreads;
|
||||
hasJoined = JoinedThreadsStore.hasJoined;
|
||||
id = channel.id;
|
||||
object2['forum_post_is_following'] = Reflect.apply(hasJoined, JoinedThreadsStore, [id]);
|
||||
getForumPostAttachmentMimetypesBinding = getForumPostAttachmentMimetypes;
|
||||
id = channel.id;
|
||||
object2['forum_post_attachment_mimetypes'] = getForumPostAttachmentMimetypesBinding(id);
|
||||
r1 = object2;
|
||||
} else {
|
||||
r1 = null;
|
||||
}
|
||||
} else {
|
||||
r1 = null;
|
||||
}
|
||||
return r1;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user