feat: Add emoji and alot of other fixes

This commit is contained in:
2026-06-05 05:40:18 +02:00
parent ca069e2f61
commit 6865147e8f
72 changed files with 3885 additions and 413 deletions

View File

@@ -266,14 +266,16 @@ function handleSyncBatch(
const { db, attachments } = ctx;
if (hasAttachmentMetaMap(scopedEvent.attachments)) {
attachments.registerSyncedAttachments(
scopedEvent.attachments,
Object.fromEntries(scopedEvent.messages.map((message) => [message.id, message.roomId]))
);
}
return from((async () => {
if (hasAttachmentMetaMap(scopedEvent.attachments)) {
await attachments.registerSyncedAttachments(
scopedEvent.attachments,
Object.fromEntries(scopedEvent.messages.map((message) => [message.id, message.roomId]))
);
}
return from(processSyncBatch(scopedEvent, db, attachments)).pipe(
return processSyncBatch(scopedEvent, db, attachments);
})()).pipe(
mergeMap((toUpsert) =>
toUpsert.length > 0
? of(MessagesActions.syncMessages({ messages: toUpsert }))

View File

@@ -39,6 +39,7 @@ import { DatabaseService } from '../../infrastructure/persistence';
import { reportDebuggingError, trackDebuggingTaskFailure } from '../../core/helpers/debugging-helpers';
import { DebuggingService } from '../../core/services';
import { AttachmentFacade } from '../../domains/attachment';
import { CustomEmojiService } from '../../domains/custom-emoji';
import { hasDedicatedChatEmbed } from '../../domains/chat/domain/rules/link-embed.rules';
import { LinkMetadataService } from '../../domains/chat/application/services/link-metadata.service';
import { TimeSyncService } from '../../core/services/time-sync.service';
@@ -65,6 +66,7 @@ export class MessagesEffects {
private readonly db = inject(DatabaseService);
private readonly debugging = inject(DebuggingService);
private readonly attachments = inject(AttachmentFacade);
private readonly customEmoji = inject(CustomEmojiService);
private readonly webrtc = inject(RealtimeSessionFacade);
private readonly timeSync = inject(TimeSyncService);
private readonly linkMetadata = inject(LinkMetadataService);
@@ -257,6 +259,7 @@ export class MessagesEffects {
}
);
this.customEmoji.pushEmojisInContent(content);
this.webrtc.broadcastMessage({ type: 'chat-message',
message });
@@ -301,6 +304,7 @@ export class MessagesEffects {
}
);
this.customEmoji.pushEmojisInContent(content);
this.webrtc.broadcastMessage({ type: 'message-edited',
messageId,
content,
@@ -460,6 +464,7 @@ export class MessagesEffects {
}
);
this.customEmoji.pushEmojisInContent(emoji);
this.webrtc.broadcastMessage({ type: 'reaction-added',
messageId,
reaction });