Closed ranjeethkrao closed 4 years ago
Hi @ranjeethkrao ,
What if instead of having the fromId
and toId
as the same values, you would define the toId
as your topic ID? Then you could implement some logic on your back-end to figure where the messages should be sent to?
On this, when ng-chat triggers your adapter's sendMessage
method, you should have the ID of both sender and destinatary within the Message payload.
Thanks @rpaschoal, that is exactly how I ended up implementing eventually! Just wanted to know if there was an event which would help me ease this logic.
Anyways thanks for your reply and great job on the ng-chat!
I am using this in a scenario, where same two participants can chat on different 'topics'. So the 'friendsList' in my case is basically the various 'topics'. This makes the fields 'fromId' and 'toId' same. Hence I cannot differentiate to which 'topic' the message was sent (This info is needed in the backend to store the thread topic wise). So I am not able to get the chat window instance (basically the 'destinataryId') from which the participants are sending messages.
Is there any way to get the chat window instance or an event emitting the 'destinatryId' on which the user is typing?