Home › Forums › BP Better Messages › Is there a custom event in BM 2.0 after a user leaves a chatroom?
- This topic has 3 replies, 2 voices, and was last updated 5 months, 4 weeks ago by Support.
- December 9, 2022 at 4:42 pm #19051MaartenParticipant
Is there an event that is triggered whenever a user joins or leaves a chatroom? That would be super helpful.
Thank you for the great work.December 9, 2022 at 5:38 pm #19056SupportKeymaster
How did you detect if user joined or leave ? Let me know which exactly hooks you need and I will add using wordpress JS hooks api.December 10, 2022 at 4:15 pm #19060MaartenParticipant
Good question, that was a bit of a creative workaround actually. I made a seperate join/leave button, which would then trigger the click events on the existing BM join/leave buttons. Then after the leave button was triggered I would wait for the
bp-better-messages-reinit-endevent and know that the user had just ‘left’ which meant I could trigger a redirect.
With BM 2.0 triggering the leave button doesn’t work anymore, since the leave button is only added to the DOM after clicking the 3 dots menu. But if there would be a
bp-better-messages-leftevent, I could redirect (or do something else) whenever somebody leaves a chatroom, which would be very useful.
If it would be possible to also add a
bp-better-messages-leaveevents that would trigger joining or leaving a chatroom. That would be super helpful as well.
Thank you for considering.December 10, 2022 at 5:26 pm #19061SupportKeymaster
If need any other hooks, let me know!
- You must be logged in to reply to this topic.