mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add readAt functionality
This commit is contained in:
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user