Which prosody event gets fired when chat room members Chat in public and private?

Hi.
Is there any event I can listen to in the prosody plugin that gets fired when chat messages are sent in the Conference room?

Thank you.

module:hook(“message/bare”) , Here I’ve added log but not found any

Depends where you add it … is it in the list of modules under the muc component or whether its in the virtualhost. I think public chat messages are in the muccomponent and the private one are in virtual host, but the private messages are not bare.

Yes, in Muc module, For group chat I think I can get events by hooking:
muc-broadcast-message.
Let me check that

check this:

Got group chat event here: muc-broadcast-message

after printing event.stanza:

[<message from='asdfgh@muc.meet.jitsi/35c2aeff' 
type='groupchat' to='asdfgh@muc.meet.jitsi'>
<body>hello</body></message>]

Now I want to parse the body message (e.g here : Hello) in prosody plugin. Please can you help how to parse in lua file?

Okay, I have got the way.

local bodyMessage = stanza:get_child("body"):get_text()

hi @damencho , I have got the group message event in “muc-broadcast-message”.

Now in.
function handleBroadcastMessage(event)

event.jid and event.occupant is getting nil.

does event occupant not generated for group chat messages?

Nope, you have room and stanza params.

oh, I see, Thank you for the clarification

Need help for one other point :),
In Jitsi meet can we get the occupant jid or bare jid ?
I mean we can get :

localParticipant.id

which can be 80b9ed9a

and I want the full jid : 4zo1dmexmjcqjckl@meet.jitsi/9BGsH1Lf

is there any way or lib-jitsi-meet method that I can achieve this?

Thanks again

That is available through lib-jitsi-meet.

can you give the method name or class?

Thank you very much. Let me check this out :smiley:

hi @damencho , good morning.
I have come out a problem, let me explain.
In mod_speakerstats_component.lua file I have added

muc_module:hook("muc-broadcast-message", handleBroadcastMessage, -1);

And In, handleBroadcastMessage method I’ve some log and other activities. My question is , does attaching a method hook for an event halts it’s normal execution? As after doing this, the screenshare and video for multiple members are not working.
Your help will be appriciated. :slight_smile:

I don’t think so. But check the prosody logs for errors.

yes, strange thing is prosody log doesn’t contain any errors.

–module:hook(“muc-broadcast-message”, handleBroadcastMessage);

if I comment out the event hook, screenshare ,video is working, but after attaching hook it doesn’t work for more than 2 participants.
even just some module:log in handleBroadcastMessage affects this.