Remote connection
This commit is contained in:
@@ -10,6 +10,7 @@ import { selectCurrentRoom } from '../rooms/rooms.selectors';
|
||||
import { DatabaseService } from '../../core/services/database.service';
|
||||
import { WebRTCService } from '../../core/services/webrtc.service';
|
||||
import { TimeSyncService } from '../../core/services/time-sync.service';
|
||||
import { AttachmentService } from '../../core/services/attachment.service';
|
||||
import { Message, Reaction } from '../../core/models';
|
||||
import * as UsersActions from '../users/users.actions';
|
||||
import * as RoomsActions from '../rooms/rooms.actions';
|
||||
@@ -21,6 +22,7 @@ export class MessagesEffects {
|
||||
private db = inject(DatabaseService);
|
||||
private webrtc = inject(WebRTCService);
|
||||
private timeSync = inject(TimeSyncService);
|
||||
private attachments = inject(AttachmentService);
|
||||
|
||||
private readonly INVENTORY_LIMIT = 1000; // number of recent messages to consider
|
||||
private readonly CHUNK_SIZE = 200; // chunk size for inventory/batch transfers
|
||||
@@ -374,6 +376,24 @@ export class MessagesEffects {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'file-announce':
|
||||
this.attachments.handleFileAnnounce(event);
|
||||
return of({ type: 'NO_OP' });
|
||||
|
||||
case 'file-chunk':
|
||||
this.attachments.handleFileChunk(event);
|
||||
return of({ type: 'NO_OP' });
|
||||
|
||||
case 'file-request':
|
||||
// Uploader can fulfill request directly via AttachmentService
|
||||
this.attachments.handleFileRequest(event);
|
||||
return of({ type: 'NO_OP' });
|
||||
|
||||
case 'file-cancel':
|
||||
// Stop any in-progress upload to the requester
|
||||
this.attachments.handleFileCancel(event);
|
||||
return of({ type: 'NO_OP' });
|
||||
|
||||
case 'message-edited':
|
||||
if (event.messageId && event.content) {
|
||||
this.db.updateMessage(event.messageId, { content: event.content, editedAt: event.editedAt });
|
||||
|
||||
Reference in New Issue
Block a user