Home Forums BP Better Messages Is there a custom event in BM 2.0 after a user leaves a chatroom?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19051
    Maarten
    Participant

    In the old plugin I redirected users to a different page after they left a chatroom. I did this through the ‘bp-better-messages-reinit-end’ javascript event. But this doesn’t work anymore in BM 2.0.

    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.

    #19056
    Support
    Keymaster

    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.

    #19060
    Maarten
    Participant

    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-end event 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-left event, 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-join and bp-better-messages-leave events that would trigger joining or leaving a chatroom. That would be super helpful as well.

    Thank you for considering.

    #19061
    Support
    Keymaster
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.