mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
receive user typing
This commit is contained in:
@@ -50,6 +50,9 @@ export class MessageRepositoryService {
|
||||
|
||||
if(localActionResult.isOk()) {
|
||||
|
||||
(await this.sendTyping(data.roomId)).map((e) => {
|
||||
console.log('map', e)
|
||||
})
|
||||
const sendMessageResult = await this.messageLiveSignalRDataSourceService.sendMessage(data)
|
||||
|
||||
|
||||
@@ -101,4 +104,8 @@ export class MessageRepositoryService {
|
||||
subscribeToNewMessages(roomId: any) {
|
||||
return this.messageLocalDataSourceService.subscribeToNewMessage(roomId)
|
||||
}
|
||||
|
||||
sendTyping(ChatRoomId) {
|
||||
return this.messageLiveSignalRDataSourceService.sendTyping({ChatRoomId, UserName:SessionStore.user.FullName})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,26 +42,7 @@ export class RoomRepositoryService {
|
||||
private roomLocalDataSourceService: RoomLocalDataSourceService,
|
||||
private roomLiveDataSourceService: RoomLiveDataSourceService,
|
||||
private messageLiveDataSourceService: MessageLiveDataSourceService,
|
||||
) {
|
||||
|
||||
// this.messageLiveDataSourceService.socket.messages$.subscribe(({payload, requestId, type}) => {
|
||||
// if(payload.sender == null) {
|
||||
// delete payload.sender
|
||||
// }
|
||||
|
||||
// if(type == 'sendMessage') {
|
||||
// let clone: TableMessage = {
|
||||
// ...payload,
|
||||
// messageId: payload.id,
|
||||
// }
|
||||
|
||||
// this.roomLocalDataSourceService.updateRoom({lastMessage: clone})
|
||||
|
||||
// }
|
||||
|
||||
// })
|
||||
|
||||
}
|
||||
) {}
|
||||
|
||||
@captureAndReraiseAsync('RoomRepositoryService/list')
|
||||
async list() {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { TypingList, UserTypingLocalDataSourceService } from '../data-source/userTyping/user-typing-local-data-source.service';
|
||||
import { UserTypingLiveDataSourceService } from '../data-source/userTyping/user-typing-live-data-source.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserTypingServiceRepository {
|
||||
|
||||
constructor(
|
||||
private localDataSource: UserTypingLocalDataSourceService,
|
||||
private liveDataSource: UserTypingLiveDataSourceService
|
||||
) { }
|
||||
|
||||
async addUserTyping(ChatRoomId: any) {
|
||||
return await this.liveDataSource.sendTyping(ChatRoomId)
|
||||
}
|
||||
|
||||
async removeUserTyping(data: TypingList) {
|
||||
return await this.localDataSource.removeUserTyping(data)
|
||||
}
|
||||
|
||||
|
||||
getUserTypingLive() {
|
||||
return this.localDataSource.getUserTypingLive()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user