mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
recei and clear the code
This commit is contained in:
+27
-20
@@ -8,6 +8,7 @@ import { InstanceId } from '../../../domain/chat-service.service';
|
||||
import { MessageUpdateInput } from '../../../domain/use-case/message-update-by-id-use-case.service';
|
||||
import { MessageOutPutDataDTO } from '../../dto/message/messageOutputDTO';
|
||||
import { MessageInputDTO } from '../../dto/message/messageInputDtO';
|
||||
import { MessageReactionInput } from '../../../domain/use-case/message-reaction-by-id-use-case.service';
|
||||
|
||||
interface msgObj {
|
||||
roomId: string;
|
||||
@@ -48,15 +49,18 @@ export class MessageSocketRepositoryService {
|
||||
return this.socket.establishConnection();
|
||||
}
|
||||
|
||||
async sendMessage(data: msgObj) {
|
||||
async join() {
|
||||
return await this.socket.join()
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await this.socket.sendMessage(data)
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
return err(e)
|
||||
}
|
||||
|
||||
async sendGroupMessage(data: MessageInputDTO) {
|
||||
const result = await this.socket.sendData<MessageOutPutDataDTO>({
|
||||
method: 'sendMessage',
|
||||
data: data,
|
||||
})
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async sendDirectMessage(data: MessageInputDTO) {
|
||||
@@ -86,6 +90,15 @@ export class MessageSocketRepositoryService {
|
||||
return result;
|
||||
}
|
||||
|
||||
async sendDelete(data: MessageDeleteInputDTO) {
|
||||
const result = await this.socket.sendData<any>({
|
||||
method: 'ReadAt',
|
||||
data: data,
|
||||
})
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
listenToMessages() {
|
||||
return this.socket.getMessage()
|
||||
}
|
||||
@@ -101,7 +114,7 @@ export class MessageSocketRepositoryService {
|
||||
}
|
||||
|
||||
|
||||
reactToMessageSocket(data) {
|
||||
reactToMessageSocket(data: MessageReactionInput) {
|
||||
this.socket.sendData({
|
||||
method: 'ReactMessage',
|
||||
data
|
||||
@@ -115,23 +128,17 @@ export class MessageSocketRepositoryService {
|
||||
})
|
||||
}
|
||||
|
||||
sendTyping(roomId) {
|
||||
return this.socket.sendTyping({
|
||||
roomId,
|
||||
UserName:SessionStore.user.FullName,
|
||||
userId: SessionStore.user.UserId
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
sendMessageDelete(data: MessageDeleteInputDTO) {
|
||||
|
||||
data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
|
||||
return this.socket.sendMessageDelete(data)
|
||||
const result = this.socket.sendData<any>({
|
||||
method: 'DeleteMessage',
|
||||
data: data,
|
||||
})
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user