fix chat estracture

This commit is contained in:
Peter Maquiran
2024-07-25 08:51:04 +01:00
parent f4589aa96e
commit 9e6d7c2b4a
17 changed files with 132 additions and 65 deletions
@@ -42,7 +42,8 @@ export class MessageRepositoryService {
data['requestId'] = InstanceId +'@'+ uuidv4();
const localActionResult = await this.messageLocalDataSourceService.sendMessage(data)
const localActionResult = await this.messageLocalDataSourceService.sendMessage({...data})
console.log('create message', data)
// this.messageLiveDataSourceService.sendMessage({
// type: 'sendMessage',
@@ -63,17 +64,20 @@ export class MessageRepositoryService {
delete sendMessageResult.value.sender
}
let clone: TableMessage = {
...sendMessageResult.value,
messageId: sendMessageResult.value.id,
id : localActionResult.value
}
// let clone: TableMessage = {
// ...sendMessageResult.value,
// messageId: sendMessageResult.value.id,
// id : localActionResult.value
// }
return this.messageLocalDataSourceService.update({...clone, sending: false})
// console.log({clone})
console.log('update message')
//return this.messageLocalDataSourceService.update({...clone, sending: false})
return ok(true)
}
} else {
return this.messageLocalDataSourceService.update({sending: false})
// return this.messageLocalDataSourceService.update({sending: false})
}
}
@@ -82,7 +86,7 @@ export class MessageRepositoryService {
if(result.isOk()) {
if(result.value) {
return await this.messageLiveSignalRDataSourceService.sendReadAt({roomId, memberId: SessionStore.user.UserId, chatMessageId: result.value.messageId})
// return await this.messageLiveSignalRDataSourceService.sendReadAt({roomId, memberId: SessionStore.user.UserId, chatMessageId: result.value.messageId})
}
return ok(true)
}
@@ -116,6 +120,14 @@ export class MessageRepositoryService {
}
sendTyping(roomId) {
return this.messageLiveSignalRDataSourceService.sendTyping({roomId, UserName:SessionStore.user.FullName})
return this.messageLiveSignalRDataSourceService.sendTyping({
roomId,
UserName:SessionStore.user.FullName,
userId: SessionStore.user.UserId
})
}
getMemberByLive({roomId, userId}) {
}
}