add readAt functionality

This commit is contained in:
Peter Maquiran
2024-07-18 16:19:30 +01:00
parent cf6fe3a4c8
commit cd1c61fe86
11 changed files with 120 additions and 33 deletions
@@ -3,17 +3,21 @@ import { BehaviorSubject } from 'rxjs';
import { Platform } from '@ionic/angular';
import { SignalRConnection } from './signalR';
import { Plugins } from '@capacitor/core';
import { z } from 'zod';
import { UserTypingDTO } from '../../data/dto/typing/typingInputDTO';
import { MessageOutPutDataDTO } from '../../data/dto/message/messageOutputDTO';
const { App } = Plugins;
@Injectable({
providedIn: 'root'
})
export class SignalRService {
private connection: SignalRConnection;
private messageSubject: BehaviorSubject<string> = new BehaviorSubject<any>(null);
private typingSubject: BehaviorSubject<string> = new BehaviorSubject<any>(null);
private messageSubject: BehaviorSubject<MessageOutPutDataDTO> = new BehaviorSubject<MessageOutPutDataDTO>(null);
private typingSubject: BehaviorSubject<UserTypingDTO> = new BehaviorSubject<UserTypingDTO>(null);
private connectingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null);
constructor(
@@ -73,7 +77,7 @@ export class SignalRService {
}
getTyping() {
return this.typingSubject.asObservable()
return this.typingSubject.asObservable().pipe()
}
async sendMessage(data: Object) {
@@ -84,7 +88,11 @@ export class SignalRService {
this.establishConnection()
}
async sendTyping({ChatRoomId, UserName}) {
return await this.connection.typing({ ChatRoomId, UserName})
async sendTyping({roomId, UserName}) {
return await this.connection.typing({ roomId, UserName})
}
async sendReadAt({ roomId, memberId, chatMessageId}) {
return await this.connection.sendReadAt({ roomId, memberId, chatMessageId})
}
}