@corva/chat-core 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -1
- package/dist/index.js +62 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1110,6 +1110,10 @@ declare class SessionManager {
|
|
|
1110
1110
|
declare function saveLastOpenedRoom(roomId: string, userId: string): void;
|
|
1111
1111
|
declare function getLastOpenedRoom(userId: string): string | null;
|
|
1112
1112
|
declare function clearLastOpenedRoom(userId: string): void;
|
|
1113
|
+
declare function saveLastOpenedThread(roomId: string, threadId: string, userId: string): void;
|
|
1114
|
+
/** The thread the user last had open in this room, if they didn't close it. */
|
|
1115
|
+
declare function getLastOpenedThread(userId: string, roomId: string): string | null;
|
|
1116
|
+
declare function clearLastOpenedThread(userId: string): void;
|
|
1113
1117
|
declare function saveLastChatActivity(userId: string): void;
|
|
1114
1118
|
declare function wasRecentlyActive(userId: string, thresholdDays?: number): boolean;
|
|
1115
1119
|
|
|
@@ -1802,4 +1806,4 @@ declare const createSocketEventHandlers: (config: SocketEventHandlersConfig) =>
|
|
|
1802
1806
|
|
|
1803
1807
|
declare const installUnreadWatcher: () => void;
|
|
1804
1808
|
|
|
1805
|
-
export { ALERT_SEVERITY, ASSET_API_FIELDS, ASSET_CHAT_PREFIXES, ASSET_NOUN, type AckScheduler, type AlertData, type AlertSeverity, type AlertWirePayload, type AppCommentAttachment, type AppCommentData, type AppCommentWirePayload, type AppStateAdapter, type AskCorvaData, type AskCorvaWirePayload, type AssetChatChannel, type AssetChatSession, type AssetStore, type Attachment, type AuthStore, CHANNEL_NAME_MAX_LENGTH, CHANNEL_TYPES, CORVA_JOIN_MESSAGE_TYPE, CORVA_MESSAGE_TYPES, CORVA_SYS_PREFIX, type ChannelAsset, type ChannelContentFilter, type ChannelContentFilterStore, type ChannelContentFilters, type ChannelNameValidation, type ChannelNotificationPreference, type ChannelNotificationSetting, type ChannelUnread, type ChatAsset, type ChatAssetIdentity, type ChatAssetType, type ChatDates, type ChatHost, type ChatNotifier, type ChatPlatform, type CorvaAPIUser, type CorvaApiAdapter, type CorvaRevoltAuthResponse, type CorvaSystemMessage, type CorvaUser, type CorvaUserService, DATE_SEPARATOR_LABELS, DEFAULT_CHANNEL_CONTENT_FILTER, DEFAULT_CHANNEL_CONTENT_FILTERS, DEFAULT_CHANNEL_PREFERENCE, DEFAULT_FAVORITE_ROOMS_SETTINGS, DEFAULT_HIDDEN_ROOMS_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_ROOM_LIST_ORDER, DIRECT_MESSAGE_PLACEHOLDER, type EditableMentionText, type ExternalChannel, type FavoriteRoomsSettings, type FavoriteRoomsStore, type FeedItemData, type FeedWirePayload, type FileAttachment, type FilterEntityWindow, type ForwardWirePayload, type ForwardedFrom, GENERAL_CHAT_NAME, type HiddenRoomsSettings, type HttpClient, type HttpClientConfig, HttpError, type HttpRequestInit, type HttpResponseLike, type JoinRequired, type JoinWirePayload, type KeyValueStorage, type LocatorContext, type LoginCredentials, MAX_ATTACHMENT_SIZE_BYTES, MAX_ATTACHMENT_SIZE_MB, MAX_NAVIGATION_HISTORY, MENTION_BOUNDARY_SOURCE, MENTION_REPLACE_PATTERN, MENTION_SPLIT_PATTERN, MENTION_USERNAME_SOURCE, MUTE_PRESET_OPTIONS, type MemberStore, type MentionDisplayResolver, type MentionFormat, type MentionLookupOptions, type MentionSegment, type MentionTextSegment, type MentionUserIds, type Message, type MessageCache, type MessageFormData, type MessageStore, NOTIFICATION_DESTINATIONS, NOTIFICATION_SETTING_ALL, NOTIFICATION_SETTING_MENTIONS, NOTIFICATION_SETTING_NOTHING, type NavigationEntry, type NavigationHistoryStore, type NotificationDestination, type NotificationPreferences, type NotificationSettings, type NotificationStore, type OutgoingMentionOptions, PAUSE_INDEFINITELY, PAUSE_PRESETS, PAUSE_PRESET_OPTIONS, type PausePreset, type PausePresetOption, REVOLT_SYSTEM_USER_ID, ROOM_LIST_ORDER, type ReadyChannelData, type RevoltAPIInstance, type RevoltChannel, type RevoltIncomingMessagePayload, type RevoltLoginResponse, type RevoltMessage, type RevoltMessageResponse, type RevoltSocketConfig, type RevoltSocketEventHandlers, type RevoltSocketInstance, type RevoltUploadResponse, type RevoltUserResponse, type Room, type RoomListOrder, type RoomStore, type RoomType, SESSION_STORAGE_KEY, SIDEBAR_SECTIONS, SIDEBAR_TABS, SOFT_DELETE_MARKER, SYSTEM_MESSAGE_TEXTS, type SaveSessionParams, type SelectableAssetType, type SessionData, SessionManager, type SharedFile, type SharedRefs, type SidebarSectionKey, type SidebarTabKey, type SocketCloseEventLike, type SocketEventHandlersConfig, type StoredChannelPreference, type Subscription, type TextSegment, type TracesViewportRequest, type TypingManager, type UIStore, type UploadAndSendResult, type UploadFile, type UploadedFile, type User, type UserStatus, type ViewportDeepLink, type ViewportIndexCurve, type ViewportMode, WEBSOCKET_CONNECTING, WEBSOCKET_OPEN, type WebSocketLike, type WireSeverity, addMessage, addOrUpdateSubscription, alertMessageAsText, assetStore, authStore, buildAppCommentMessageContent, buildAskCorvaMessageContent, buildFinalMessage, buildForwardMessageContent, buildGroupChannelName, canDeleteMessage, canEditMessage, channelContentFilterStore, channelToAsset, chatToastStore, clearLastOpenedRoom, compareByActivity, compareByName, compareByRecencyDesc, configureChat, configureChatStorage, createAckScheduler, createCorvaUserService, createDMSubscription, createGroupSubscription, createHttpClient, createLatestWinsQueue, createMemoryStorage, createMessageCache, createRevoltAPI, createRevoltSocket, createRoomTaskQueue, createSocketEventHandlers, createSoftDeletedMessage, createTypingManager, decodeMentionsForEdit, deriveAllowedChatAsset, encodeMentionsForSend, encodeOutgoingMentions, enrichWithCorvaData, ensureChatSession, extractTimestampFromULID, failOptimisticMessage, favoriteRoomsStore, findGeneralRoom, findMentionUserById, findMentionUserByUsername, formatAssetChatName, getAppCommentAttachments, getAssetChatChannel, getAssetChatSession, getAssetTypeFromDisplayName, getChatHost, getChatStorage, getCorvaUserFields, getCorvaUserName, getExternalChannel, getHydratedAckedId, getLastOpenedRoom, getMentionLabel, getMentionSearchHandle, getMentionedUserIds, getMessageTimestamp, getPauseUntil, getPlatformMentionUserIds, getReactionCount, getRoomDisplayName, getSystemMessageWithCorvaNames, getUserDisplayName, getUserSecondaryText, handleUnauthorized, hasReactions, hasUserReacted, initChat, installUnreadWatcher, isAlertMessage, isAppCommentMessage, isAskCorvaMessage, isChannelMuted, isChatAssetTypeAllowed, isChatStorageConfigured, isCurrentRoomSelection, isDeepEqual, isDefaultChannelPreference, isDisallowedAssetChatRoom, isDmGroup, isExternalServerChannel, isForwardedMessage, isGeneralRoom, isNotificationsPaused, isPauseActive, isSoftDeletedMessage, isSystemMessage, isUnknownMention, isUnread, isUserOnline, isValidPausePreset, isVisibleUnread, keepChatUsed, loadUntilFound, mapCorvaMessageNote, memberStore, messageStore, navigationHistoryStore, notificationStore, onChatStorageConfigured, parseCorvaSystemMessage, prepareRoomSelection, removeMessageFromList, removeSubscription, resetAssetStore, resetAuthStore, resetChannelContentFilterStore, resetChatAssetPermissionsSnapshot, resetChatHost, resetFavoriteRoomsStore, resetMemberStore, resetMessageStore, resetNavigationHistoryStore, resetNotificationStore, resetRoomStore, resetUIStore, resolveMentionDisplayName, roomStore, saveLastChatActivity, saveLastOpenedRoom, searchMessages, searchRooms, searchUsers, selectCanGoBack, selectCanGoForward, setAllowedChatAssetTypes, settleOptimisticMessage, sharedRefs, sortChannels, sortDMs, sortMessagesByTime, sortUsersByStatus, stripPlatformMentions, toEditableMentionText, toReadableMentionText, toReadableText, tokenizeMentions, uiStore, updateMessageInList, uploadAndSend, validateChannelName, waitForNextPaint, wasRecentlyActive, withChannelPreferenceDefaults };
|
|
1809
|
+
export { ALERT_SEVERITY, ASSET_API_FIELDS, ASSET_CHAT_PREFIXES, ASSET_NOUN, type AckScheduler, type AlertData, type AlertSeverity, type AlertWirePayload, type AppCommentAttachment, type AppCommentData, type AppCommentWirePayload, type AppStateAdapter, type AskCorvaData, type AskCorvaWirePayload, type AssetChatChannel, type AssetChatSession, type AssetStore, type Attachment, type AuthStore, CHANNEL_NAME_MAX_LENGTH, CHANNEL_TYPES, CORVA_JOIN_MESSAGE_TYPE, CORVA_MESSAGE_TYPES, CORVA_SYS_PREFIX, type ChannelAsset, type ChannelContentFilter, type ChannelContentFilterStore, type ChannelContentFilters, type ChannelNameValidation, type ChannelNotificationPreference, type ChannelNotificationSetting, type ChannelUnread, type ChatAsset, type ChatAssetIdentity, type ChatAssetType, type ChatDates, type ChatHost, type ChatNotifier, type ChatPlatform, type CorvaAPIUser, type CorvaApiAdapter, type CorvaRevoltAuthResponse, type CorvaSystemMessage, type CorvaUser, type CorvaUserService, DATE_SEPARATOR_LABELS, DEFAULT_CHANNEL_CONTENT_FILTER, DEFAULT_CHANNEL_CONTENT_FILTERS, DEFAULT_CHANNEL_PREFERENCE, DEFAULT_FAVORITE_ROOMS_SETTINGS, DEFAULT_HIDDEN_ROOMS_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_ROOM_LIST_ORDER, DIRECT_MESSAGE_PLACEHOLDER, type EditableMentionText, type ExternalChannel, type FavoriteRoomsSettings, type FavoriteRoomsStore, type FeedItemData, type FeedWirePayload, type FileAttachment, type FilterEntityWindow, type ForwardWirePayload, type ForwardedFrom, GENERAL_CHAT_NAME, type HiddenRoomsSettings, type HttpClient, type HttpClientConfig, HttpError, type HttpRequestInit, type HttpResponseLike, type JoinRequired, type JoinWirePayload, type KeyValueStorage, type LocatorContext, type LoginCredentials, MAX_ATTACHMENT_SIZE_BYTES, MAX_ATTACHMENT_SIZE_MB, MAX_NAVIGATION_HISTORY, MENTION_BOUNDARY_SOURCE, MENTION_REPLACE_PATTERN, MENTION_SPLIT_PATTERN, MENTION_USERNAME_SOURCE, MUTE_PRESET_OPTIONS, type MemberStore, type MentionDisplayResolver, type MentionFormat, type MentionLookupOptions, type MentionSegment, type MentionTextSegment, type MentionUserIds, type Message, type MessageCache, type MessageFormData, type MessageStore, NOTIFICATION_DESTINATIONS, NOTIFICATION_SETTING_ALL, NOTIFICATION_SETTING_MENTIONS, NOTIFICATION_SETTING_NOTHING, type NavigationEntry, type NavigationHistoryStore, type NotificationDestination, type NotificationPreferences, type NotificationSettings, type NotificationStore, type OutgoingMentionOptions, PAUSE_INDEFINITELY, PAUSE_PRESETS, PAUSE_PRESET_OPTIONS, type PausePreset, type PausePresetOption, REVOLT_SYSTEM_USER_ID, ROOM_LIST_ORDER, type ReadyChannelData, type RevoltAPIInstance, type RevoltChannel, type RevoltIncomingMessagePayload, type RevoltLoginResponse, type RevoltMessage, type RevoltMessageResponse, type RevoltSocketConfig, type RevoltSocketEventHandlers, type RevoltSocketInstance, type RevoltUploadResponse, type RevoltUserResponse, type Room, type RoomListOrder, type RoomStore, type RoomType, SESSION_STORAGE_KEY, SIDEBAR_SECTIONS, SIDEBAR_TABS, SOFT_DELETE_MARKER, SYSTEM_MESSAGE_TEXTS, type SaveSessionParams, type SelectableAssetType, type SessionData, SessionManager, type SharedFile, type SharedRefs, type SidebarSectionKey, type SidebarTabKey, type SocketCloseEventLike, type SocketEventHandlersConfig, type StoredChannelPreference, type Subscription, type TextSegment, type TracesViewportRequest, type TypingManager, type UIStore, type UploadAndSendResult, type UploadFile, type UploadedFile, type User, type UserStatus, type ViewportDeepLink, type ViewportIndexCurve, type ViewportMode, WEBSOCKET_CONNECTING, WEBSOCKET_OPEN, type WebSocketLike, type WireSeverity, addMessage, addOrUpdateSubscription, alertMessageAsText, assetStore, authStore, buildAppCommentMessageContent, buildAskCorvaMessageContent, buildFinalMessage, buildForwardMessageContent, buildGroupChannelName, canDeleteMessage, canEditMessage, channelContentFilterStore, channelToAsset, chatToastStore, clearLastOpenedRoom, clearLastOpenedThread, compareByActivity, compareByName, compareByRecencyDesc, configureChat, configureChatStorage, createAckScheduler, createCorvaUserService, createDMSubscription, createGroupSubscription, createHttpClient, createLatestWinsQueue, createMemoryStorage, createMessageCache, createRevoltAPI, createRevoltSocket, createRoomTaskQueue, createSocketEventHandlers, createSoftDeletedMessage, createTypingManager, decodeMentionsForEdit, deriveAllowedChatAsset, encodeMentionsForSend, encodeOutgoingMentions, enrichWithCorvaData, ensureChatSession, extractTimestampFromULID, failOptimisticMessage, favoriteRoomsStore, findGeneralRoom, findMentionUserById, findMentionUserByUsername, formatAssetChatName, getAppCommentAttachments, getAssetChatChannel, getAssetChatSession, getAssetTypeFromDisplayName, getChatHost, getChatStorage, getCorvaUserFields, getCorvaUserName, getExternalChannel, getHydratedAckedId, getLastOpenedRoom, getLastOpenedThread, getMentionLabel, getMentionSearchHandle, getMentionedUserIds, getMessageTimestamp, getPauseUntil, getPlatformMentionUserIds, getReactionCount, getRoomDisplayName, getSystemMessageWithCorvaNames, getUserDisplayName, getUserSecondaryText, handleUnauthorized, hasReactions, hasUserReacted, initChat, installUnreadWatcher, isAlertMessage, isAppCommentMessage, isAskCorvaMessage, isChannelMuted, isChatAssetTypeAllowed, isChatStorageConfigured, isCurrentRoomSelection, isDeepEqual, isDefaultChannelPreference, isDisallowedAssetChatRoom, isDmGroup, isExternalServerChannel, isForwardedMessage, isGeneralRoom, isNotificationsPaused, isPauseActive, isSoftDeletedMessage, isSystemMessage, isUnknownMention, isUnread, isUserOnline, isValidPausePreset, isVisibleUnread, keepChatUsed, loadUntilFound, mapCorvaMessageNote, memberStore, messageStore, navigationHistoryStore, notificationStore, onChatStorageConfigured, parseCorvaSystemMessage, prepareRoomSelection, removeMessageFromList, removeSubscription, resetAssetStore, resetAuthStore, resetChannelContentFilterStore, resetChatAssetPermissionsSnapshot, resetChatHost, resetFavoriteRoomsStore, resetMemberStore, resetMessageStore, resetNavigationHistoryStore, resetNotificationStore, resetRoomStore, resetUIStore, resolveMentionDisplayName, roomStore, saveLastChatActivity, saveLastOpenedRoom, saveLastOpenedThread, searchMessages, searchRooms, searchUsers, selectCanGoBack, selectCanGoForward, setAllowedChatAssetTypes, settleOptimisticMessage, sharedRefs, sortChannels, sortDMs, sortMessagesByTime, sortUsersByStatus, stripPlatformMentions, toEditableMentionText, toReadableMentionText, toReadableText, tokenizeMentions, uiStore, updateMessageInList, uploadAndSend, validateChannelName, waitForNextPaint, wasRecentlyActive, withChannelPreferenceDefaults };
|
package/dist/index.js
CHANGED
|
@@ -1119,6 +1119,7 @@ var removeMessageFromList = (messages, messageId) => {
|
|
|
1119
1119
|
|
|
1120
1120
|
// src/store/services/lastRoomTracker.ts
|
|
1121
1121
|
var STORAGE_KEY_PREFIX = "corva_chat_last_room";
|
|
1122
|
+
var THREAD_KEY_PREFIX = "corva_chat_last_thread";
|
|
1122
1123
|
var ACTIVITY_KEY_PREFIX = "corva_chat_last_activity";
|
|
1123
1124
|
var DEFAULT_ACTIVITY_THRESHOLD_DAYS = 3;
|
|
1124
1125
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -1149,6 +1150,34 @@ function clearLastOpenedRoom(userId) {
|
|
|
1149
1150
|
console.error("Failed to clear last opened room");
|
|
1150
1151
|
}
|
|
1151
1152
|
}
|
|
1153
|
+
function getThreadKey(userId) {
|
|
1154
|
+
return `${THREAD_KEY_PREFIX}_${userId}`;
|
|
1155
|
+
}
|
|
1156
|
+
function saveLastOpenedThread(roomId, threadId, userId) {
|
|
1157
|
+
try {
|
|
1158
|
+
const thread = { roomId, threadId };
|
|
1159
|
+
getChatStorage().setItem(getThreadKey(userId), JSON.stringify(thread));
|
|
1160
|
+
} catch {
|
|
1161
|
+
console.error("Failed to save last opened thread");
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
function getLastOpenedThread(userId, roomId) {
|
|
1165
|
+
try {
|
|
1166
|
+
const stored = getChatStorage().getItem(getThreadKey(userId));
|
|
1167
|
+
if (!stored) return null;
|
|
1168
|
+
const thread = JSON.parse(stored);
|
|
1169
|
+
return thread.roomId === roomId && typeof thread.threadId === "string" ? thread.threadId : null;
|
|
1170
|
+
} catch {
|
|
1171
|
+
return null;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
function clearLastOpenedThread(userId) {
|
|
1175
|
+
try {
|
|
1176
|
+
getChatStorage().removeItem(getThreadKey(userId));
|
|
1177
|
+
} catch {
|
|
1178
|
+
console.error("Failed to clear last opened thread");
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1152
1181
|
function saveLastChatActivity(userId) {
|
|
1153
1182
|
try {
|
|
1154
1183
|
getChatStorage().setItem(getActivityKey(userId), String(Date.now()));
|
|
@@ -2963,6 +2992,15 @@ var messageStore = createStore()((set, get) => ({
|
|
|
2963
2992
|
}));
|
|
2964
2993
|
var resetMessageStore = () => messageStore.setState(getInitialState5());
|
|
2965
2994
|
|
|
2995
|
+
// src/utils/getTimeZone.ts
|
|
2996
|
+
var getTimeZone = () => {
|
|
2997
|
+
try {
|
|
2998
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || void 0;
|
|
2999
|
+
} catch {
|
|
3000
|
+
return void 0;
|
|
3001
|
+
}
|
|
3002
|
+
};
|
|
3003
|
+
|
|
2966
3004
|
// src/utils/isDeepEqual.ts
|
|
2967
3005
|
function isDeepEqual(a, b) {
|
|
2968
3006
|
if (Object.is(a, b)) return true;
|
|
@@ -3275,9 +3313,10 @@ var authStore = createStore()((set, get) => ({
|
|
|
3275
3313
|
setChatError2(null);
|
|
3276
3314
|
set({ isConnected: false });
|
|
3277
3315
|
try {
|
|
3316
|
+
const timeZone = getTimeZone();
|
|
3278
3317
|
const revoltSession = await getChatHost().corvaApi.post(
|
|
3279
3318
|
"/v2/integration/revolt_chat_sessions",
|
|
3280
|
-
{}
|
|
3319
|
+
timeZone ? { time_zone: timeZone } : {}
|
|
3281
3320
|
);
|
|
3282
3321
|
if (!revoltSession?.revolt_session_token) {
|
|
3283
3322
|
throw new Error("No valid session token received from Corva backend");
|
|
@@ -4518,34 +4557,29 @@ function createChannelsAPI(http) {
|
|
|
4518
4557
|
async function getRooms(serverId) {
|
|
4519
4558
|
try {
|
|
4520
4559
|
const channelMap = /* @__PURE__ */ new Map();
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
const server = await http.request(
|
|
4524
|
-
`/servers/${serverId}?include_channels=true`
|
|
4525
|
-
);
|
|
4526
|
-
const channelsPayload = server?.channels;
|
|
4527
|
-
if (Array.isArray(channelsPayload) && channelsPayload.length > 0) {
|
|
4528
|
-
channelsPayload.forEach((channel) => {
|
|
4529
|
-
if (channel?._id && channel.channel_type === CHANNEL_TYPES.TEXT_CHANNEL) {
|
|
4530
|
-
channelMap.set(channel._id, channel);
|
|
4531
|
-
}
|
|
4532
|
-
});
|
|
4533
|
-
}
|
|
4534
|
-
} catch (e) {
|
|
4560
|
+
const [serverChannels, dms] = await Promise.all([
|
|
4561
|
+
serverId ? http.request(`/servers/${serverId}?include_channels=true`).then((server) => server?.channels).catch((e) => {
|
|
4535
4562
|
console.error("Failed to fetch channels:", e);
|
|
4536
|
-
|
|
4563
|
+
return void 0;
|
|
4564
|
+
}) : void 0,
|
|
4565
|
+
http.request("/users/dms").catch((e) => {
|
|
4566
|
+
console.error("Failed to fetch DMs:", e);
|
|
4567
|
+
return void 0;
|
|
4568
|
+
})
|
|
4569
|
+
]);
|
|
4570
|
+
if (Array.isArray(serverChannels)) {
|
|
4571
|
+
serverChannels.forEach((channel) => {
|
|
4572
|
+
if (channel?._id && channel.channel_type === CHANNEL_TYPES.TEXT_CHANNEL) {
|
|
4573
|
+
channelMap.set(channel._id, channel);
|
|
4574
|
+
}
|
|
4575
|
+
});
|
|
4537
4576
|
}
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
}
|
|
4545
|
-
});
|
|
4546
|
-
}
|
|
4547
|
-
} catch (e) {
|
|
4548
|
-
console.error("Failed to fetch DMs:", e);
|
|
4577
|
+
if (Array.isArray(dms)) {
|
|
4578
|
+
dms.forEach((channel) => {
|
|
4579
|
+
if (channel?._id) {
|
|
4580
|
+
channelMap.set(channel._id, channel);
|
|
4581
|
+
}
|
|
4582
|
+
});
|
|
4549
4583
|
}
|
|
4550
4584
|
const rooms = [];
|
|
4551
4585
|
channelMap.forEach((channel) => {
|
|
@@ -6202,6 +6236,6 @@ function ensureChatSession(corvaUser) {
|
|
|
6202
6236
|
return inFlight;
|
|
6203
6237
|
}
|
|
6204
6238
|
|
|
6205
|
-
export { ALERT_SEVERITY, ASSET_API_FIELDS, ASSET_CHAT_PREFIXES, ASSET_NOUN, CHANNEL_NAME_MAX_LENGTH, CHANNEL_TYPES, CORVA_JOIN_MESSAGE_TYPE, CORVA_MESSAGE_TYPES, CORVA_SYS_PREFIX, DATE_SEPARATOR_LABELS, DEFAULT_CHANNEL_CONTENT_FILTER, DEFAULT_CHANNEL_CONTENT_FILTERS, DEFAULT_CHANNEL_PREFERENCE, DEFAULT_FAVORITE_ROOMS_SETTINGS, DEFAULT_HIDDEN_ROOMS_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_ROOM_LIST_ORDER, DIRECT_MESSAGE_PLACEHOLDER, GENERAL_CHAT_NAME, HttpError, MAX_ATTACHMENT_SIZE_BYTES, MAX_ATTACHMENT_SIZE_MB, MAX_NAVIGATION_HISTORY, MENTION_BOUNDARY_SOURCE, MENTION_REPLACE_PATTERN, MENTION_SPLIT_PATTERN, MENTION_USERNAME_SOURCE, MUTE_PRESET_OPTIONS, NOTIFICATION_DESTINATIONS, NOTIFICATION_SETTING_ALL, NOTIFICATION_SETTING_MENTIONS, NOTIFICATION_SETTING_NOTHING, PAUSE_INDEFINITELY, PAUSE_PRESETS, PAUSE_PRESET_OPTIONS, REVOLT_SYSTEM_USER_ID, ROOM_LIST_ORDER, SESSION_STORAGE_KEY, SIDEBAR_SECTIONS, SIDEBAR_TABS, SOFT_DELETE_MARKER, SYSTEM_MESSAGE_TEXTS, SessionManager, WEBSOCKET_CONNECTING, WEBSOCKET_OPEN, addMessage, addOrUpdateSubscription, alertMessageAsText, assetStore, authStore, buildAppCommentMessageContent, buildAskCorvaMessageContent, buildFinalMessage, buildForwardMessageContent, buildGroupChannelName, canDeleteMessage, canEditMessage, channelContentFilterStore, channelToAsset, chatToastStore, clearLastOpenedRoom, compareByActivity, compareByName, compareByRecencyDesc, configureChat, configureChatStorage, createAckScheduler, createCorvaUserService, createDMSubscription, createGroupSubscription, createHttpClient, createLatestWinsQueue, createMemoryStorage, createMessageCache, createRevoltAPI, createRevoltSocket, createRoomTaskQueue, createSocketEventHandlers, createSoftDeletedMessage, createTypingManager, decodeMentionsForEdit, deriveAllowedChatAsset, encodeMentionsForSend, encodeOutgoingMentions, enrichWithCorvaData, ensureChatSession, extractTimestampFromULID, failOptimisticMessage, favoriteRoomsStore, findGeneralRoom, findMentionUserById, findMentionUserByUsername, formatAssetChatName, getAppCommentAttachments, getAssetChatChannel, getAssetChatSession, getAssetTypeFromDisplayName, getChatHost, getChatStorage, getCorvaUserFields, getCorvaUserName, getExternalChannel, getHydratedAckedId, getLastOpenedRoom, getMentionLabel, getMentionSearchHandle, getMentionedUserIds, getMessageTimestamp, getPauseUntil, getPlatformMentionUserIds, getReactionCount, getRoomDisplayName, getSystemMessageWithCorvaNames, getUserDisplayName, getUserSecondaryText, handleUnauthorized, hasReactions, hasUserReacted, initChat, installUnreadWatcher, isAlertMessage, isAppCommentMessage, isAskCorvaMessage, isChannelMuted, isChatAssetTypeAllowed, isChatStorageConfigured, isCurrentRoomSelection, isDeepEqual, isDefaultChannelPreference, isDisallowedAssetChatRoom, isDmGroup, isExternalServerChannel, isForwardedMessage, isGeneralRoom, isNotificationsPaused, isPauseActive, isSoftDeletedMessage, isSystemMessage, isUnknownMention, isUnread, isUserOnline, isValidPausePreset, isVisibleUnread, keepChatUsed, loadUntilFound, mapCorvaMessageNote, memberStore, messageStore, navigationHistoryStore, notificationStore, onChatStorageConfigured, parseCorvaSystemMessage, prepareRoomSelection, removeMessageFromList, removeSubscription, resetAssetStore, resetAuthStore, resetChannelContentFilterStore, resetChatAssetPermissionsSnapshot, resetChatHost, resetFavoriteRoomsStore, resetMemberStore, resetMessageStore, resetNavigationHistoryStore, resetNotificationStore, resetRoomStore, resetUIStore, resolveMentionDisplayName, roomStore, saveLastChatActivity, saveLastOpenedRoom, searchMessages, searchRooms, searchUsers, selectCanGoBack, selectCanGoForward, setAllowedChatAssetTypes, settleOptimisticMessage, sharedRefs, sortChannels, sortDMs, sortMessagesByTime, sortUsersByStatus, stripPlatformMentions, toEditableMentionText, toReadableMentionText, toReadableText, tokenizeMentions, uiStore, updateMessageInList, uploadAndSend, validateChannelName, waitForNextPaint, wasRecentlyActive, withChannelPreferenceDefaults };
|
|
6239
|
+
export { ALERT_SEVERITY, ASSET_API_FIELDS, ASSET_CHAT_PREFIXES, ASSET_NOUN, CHANNEL_NAME_MAX_LENGTH, CHANNEL_TYPES, CORVA_JOIN_MESSAGE_TYPE, CORVA_MESSAGE_TYPES, CORVA_SYS_PREFIX, DATE_SEPARATOR_LABELS, DEFAULT_CHANNEL_CONTENT_FILTER, DEFAULT_CHANNEL_CONTENT_FILTERS, DEFAULT_CHANNEL_PREFERENCE, DEFAULT_FAVORITE_ROOMS_SETTINGS, DEFAULT_HIDDEN_ROOMS_SETTINGS, DEFAULT_NOTIFICATION_PREFERENCES, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_ROOM_LIST_ORDER, DIRECT_MESSAGE_PLACEHOLDER, GENERAL_CHAT_NAME, HttpError, MAX_ATTACHMENT_SIZE_BYTES, MAX_ATTACHMENT_SIZE_MB, MAX_NAVIGATION_HISTORY, MENTION_BOUNDARY_SOURCE, MENTION_REPLACE_PATTERN, MENTION_SPLIT_PATTERN, MENTION_USERNAME_SOURCE, MUTE_PRESET_OPTIONS, NOTIFICATION_DESTINATIONS, NOTIFICATION_SETTING_ALL, NOTIFICATION_SETTING_MENTIONS, NOTIFICATION_SETTING_NOTHING, PAUSE_INDEFINITELY, PAUSE_PRESETS, PAUSE_PRESET_OPTIONS, REVOLT_SYSTEM_USER_ID, ROOM_LIST_ORDER, SESSION_STORAGE_KEY, SIDEBAR_SECTIONS, SIDEBAR_TABS, SOFT_DELETE_MARKER, SYSTEM_MESSAGE_TEXTS, SessionManager, WEBSOCKET_CONNECTING, WEBSOCKET_OPEN, addMessage, addOrUpdateSubscription, alertMessageAsText, assetStore, authStore, buildAppCommentMessageContent, buildAskCorvaMessageContent, buildFinalMessage, buildForwardMessageContent, buildGroupChannelName, canDeleteMessage, canEditMessage, channelContentFilterStore, channelToAsset, chatToastStore, clearLastOpenedRoom, clearLastOpenedThread, compareByActivity, compareByName, compareByRecencyDesc, configureChat, configureChatStorage, createAckScheduler, createCorvaUserService, createDMSubscription, createGroupSubscription, createHttpClient, createLatestWinsQueue, createMemoryStorage, createMessageCache, createRevoltAPI, createRevoltSocket, createRoomTaskQueue, createSocketEventHandlers, createSoftDeletedMessage, createTypingManager, decodeMentionsForEdit, deriveAllowedChatAsset, encodeMentionsForSend, encodeOutgoingMentions, enrichWithCorvaData, ensureChatSession, extractTimestampFromULID, failOptimisticMessage, favoriteRoomsStore, findGeneralRoom, findMentionUserById, findMentionUserByUsername, formatAssetChatName, getAppCommentAttachments, getAssetChatChannel, getAssetChatSession, getAssetTypeFromDisplayName, getChatHost, getChatStorage, getCorvaUserFields, getCorvaUserName, getExternalChannel, getHydratedAckedId, getLastOpenedRoom, getLastOpenedThread, getMentionLabel, getMentionSearchHandle, getMentionedUserIds, getMessageTimestamp, getPauseUntil, getPlatformMentionUserIds, getReactionCount, getRoomDisplayName, getSystemMessageWithCorvaNames, getUserDisplayName, getUserSecondaryText, handleUnauthorized, hasReactions, hasUserReacted, initChat, installUnreadWatcher, isAlertMessage, isAppCommentMessage, isAskCorvaMessage, isChannelMuted, isChatAssetTypeAllowed, isChatStorageConfigured, isCurrentRoomSelection, isDeepEqual, isDefaultChannelPreference, isDisallowedAssetChatRoom, isDmGroup, isExternalServerChannel, isForwardedMessage, isGeneralRoom, isNotificationsPaused, isPauseActive, isSoftDeletedMessage, isSystemMessage, isUnknownMention, isUnread, isUserOnline, isValidPausePreset, isVisibleUnread, keepChatUsed, loadUntilFound, mapCorvaMessageNote, memberStore, messageStore, navigationHistoryStore, notificationStore, onChatStorageConfigured, parseCorvaSystemMessage, prepareRoomSelection, removeMessageFromList, removeSubscription, resetAssetStore, resetAuthStore, resetChannelContentFilterStore, resetChatAssetPermissionsSnapshot, resetChatHost, resetFavoriteRoomsStore, resetMemberStore, resetMessageStore, resetNavigationHistoryStore, resetNotificationStore, resetRoomStore, resetUIStore, resolveMentionDisplayName, roomStore, saveLastChatActivity, saveLastOpenedRoom, saveLastOpenedThread, searchMessages, searchRooms, searchUsers, selectCanGoBack, selectCanGoForward, setAllowedChatAssetTypes, settleOptimisticMessage, sharedRefs, sortChannels, sortDMs, sortMessagesByTime, sortUsersByStatus, stripPlatformMentions, toEditableMentionText, toReadableMentionText, toReadableText, tokenizeMentions, uiStore, updateMessageInList, uploadAndSend, validateChannelName, waitForNextPaint, wasRecentlyActive, withChannelPreferenceDefaults };
|
|
6206
6240
|
//# sourceMappingURL=index.js.map
|
|
6207
6241
|
//# sourceMappingURL=index.js.map
|