43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
// Module ID: 13651
|
|
// Function ID: 13652
|
|
// Name: trackAckMessages
|
|
// Dependencies: [2051, 7121, 2074, 5071, 1085, 5070, 2]
|
|
// Exports: default
|
|
|
|
// Module 13651 (trackAckMessages)
|
|
import Constants from "Constants" /* 1085 */;
|
|
import AppAnalyticsUtils from "AppAnalyticsUtils" /* 5070 */;
|
|
import ChannelStore from "ChannelStore" /* 2051 */;
|
|
import GuildReadStateStore from "GuildReadStateStore" /* 7121 */;
|
|
import GuildStore from "GuildStore" /* 2074 */;
|
|
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 5071 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const AnalyticEvents = Constants.AnalyticEvents;
|
|
const result = size.fileFinishedImporting("modules/read_states/trackAckMessages.tsx");
|
|
|
|
export default function trackAckMessages(channel_id, location) {
|
|
let guildId;
|
|
let guildsArray;
|
|
const channel = ChannelStore.getChannel(channel_id);
|
|
const obj = {
|
|
channel_id,
|
|
guild_id: guildId,
|
|
location,
|
|
guild_unread_statuses: guildsArray.map((id) => {
|
|
const hasUnreadResult = GuildReadStateStore.hasUnread(id.id);
|
|
const mentionCount = GuildReadStateStore.getMentionCount(id.id);
|
|
const isMutedResult = UserGuildSettingsStore.isMuted(id.id);
|
|
return "" + id.id + "," + hasUnreadResult + "," + mentionCount + "," + isMutedResult + "," + UserGuildSettingsStore.resolveGuildUnreadSetting(id);
|
|
})
|
|
};
|
|
guildId = undefined;
|
|
const trackWithMetadata = AppAnalyticsUtils.trackWithMetadata;
|
|
const ACK_MESSAGES = AnalyticEvents.ACK_MESSAGES;
|
|
AppAnalyticsUtils;
|
|
if (null != channel) {
|
|
guildId = channel.getGuildId();
|
|
}
|
|
guildsArray = GuildStore.getGuildsArray();
|
|
trackWithMetadata(ACK_MESSAGES, obj);
|
|
};
|