diff --git a/src/app/module/chat/infra/socket/signalR.ts b/src/app/module/chat/infra/socket/signalR.ts index 14d14ccbf..d9f96c901 100644 --- a/src/app/module/chat/infra/socket/signalR.ts +++ b/src/app/module/chat/infra/socket/signalR.ts @@ -7,6 +7,36 @@ import { v4 as uuidv4 } from 'uuid' import { UserTypingDTO } from '../../data/dto/typing/typingInputDTO'; import { MessageOutPutDataDTO } from '../../data/dto/message/messageOutputDTO'; + +var msgObj = { + roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f", + senderId:312, + message:"message enviada", + messageType:312, + canEdit:true, + oneShot:false, + requestId:"testing" + }; + // var deletObj = { + // roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f", + // senderId:312, + // messageId:"message enviada", + // requestId:"testing" + // }; + // var reactObj = { + // roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f", + // memberId:2, + // messageId:"e7074c10-4f92-458c-adb2-774ec2d42992", + // reaction:"reacted", + // requestId:"testingReaction" + // }; + const typingObj = { + roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f", + userId: 312, + userName:"usertyping", + requestId:"testing" + }; + export class SignalRConnection { private hubConnection: signalR.HubConnection; @@ -76,7 +106,7 @@ export class SignalRConnection { if(this.connectionStateSubject.value == true) { console.log('join=================') - this.hubConnection.invoke("Join", SessionStore.user.UserId, SessionStore.user.FullName); + this.hubConnection.invoke("Join", 312, SessionStore.user.FullName); //this.hubConnection.invoke("Join", 105, "UserFirefox"); } else { this.sendLaterSubject.next({method: 'SendMessage', args:["Join", 312, "Daniel"]}) @@ -89,7 +119,7 @@ export class SignalRConnection { if(this.connectionStateSubject.value == true) { console.log('sendMessage', data) - this.hubConnection.invoke("SendMessage", data) + this.hubConnection.invoke("SendMessage", msgObj) this.messageSubject.pipe( filter((message: any) => data.requestId == message?.requestId), @@ -116,12 +146,7 @@ export class SignalRConnection { console.log('send typing', data) try { - this.hubConnection.invoke("Typing", { - userName: data.UserName, - roomId: data.roomId, - userId: data.userId +'', - requestId - } as any) + this.hubConnection.invoke("Typing", typingObj) } catch (error) {} diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index bd47c37b3..7855ffadd 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -46,9 +46,21 @@
+