Am using websocket to communicate with the Rocket chat server. Am trying to implement the typing event indicator on the UI. For that, am calling “stream-notify-room” method. But it is not working.
I have initiated a ‘stream-notify-room’ subscription, when a room is created this.$socket.send({ msg: 'sub', id: '42', name: 'stream-notify-room', params: [ this.room + '/typing', false ] })
Subscription functionality is working fine. I tested and confirmed by connecting the Rocket chat server.
From the UI, On message typing, I have triggered this.$socket.send({ msg: 'method', method: 'stream-notify-room', id: '42', params: [ this.room + '/typing', this.$attrs.user.username, true ] })
From the UI, On message clear/typing stop, I have triggered this.$socket.send({ msg: 'method', method: 'stream-notify-room', id: '42', params: [ this.room + '/typing', this.$attrs.user.username, false ] })
On these two above event the socket message shows as { "msg": "result", "id": "stream-notify-room-cKe3k3Mkhk7d8i9y2" }
There is no socket message reaching on the other user(on same room) side. Am expecting some message should be reach on the other user socket and display the typing event.
I am having the same problem as this. I am trying to broadcast an event through websocket, so that other users can get notified of an event, but unfortunately only the user who sent the stream-notify-room message is receiving the message.
I tried the exact same steps as this post, but it did not work. The documentation here Notify Room Stream - Rocket.Chat Developer
indicates that other users in the room will be notified of an event. Unfortunately, no other users in the same room is receiving any message.
I solved my situation by just using the “sendMessage” method instead.
On the params, in addition to “_id”, “rid”, and “msg”, “t” can be inserted and passed around, so I think you can use that to filter the message and treat it as an “event”.
Of course, this does not mean that stream-notify-room shouldn’t work, or at least the documentation should change. There is no indication that you can pass your own “t” in “sendMessage” method, this was rather found by me just experimenting things.