Change room subject from server prosody module error

but I am struggling to set subject from server side by “muc-room-created” hook.
I tried room:set_changesubject(room,true) and then room:set_subject(room,“setter_nick”,“subject_name”) but horribly failed. am I doing something silly?

error details

I am facing errors, not sure it is for my code or core prosody error…!! as I inspected and saw that prosody calls create_subject_message(from, subject) in subject.lib.lua where we create stanza instances by sending message where there is table value inside of table and it results in error in stanza.lua.

Jun 20 05:47:38 c2s55a55ad26dc0	error	Traceback[c2s]: /usr/lib/prosody/util/stanza.lua:62: invalid attribute value: expected string, got table
stack traceback:
	[C]: in function 'error'
	/usr/lib/prosody/util/stanza.lua:62: in function 'check_text'
	/usr/lib/prosody/util/stanza.lua:75: in function 'check_attr'
	/usr/lib/prosody/util/stanza.lua:87: in function </usr/lib/prosody/util/stanza.lua:85>
	(...tail calls...)
	/usr/lib/prosody/modules/muc/subject.lib.lua:17: in function 'create_subject_message'
	/usr/lib/prosody/modules/muc/subject.lib.lua:81: in function 'set_subject'
	...jitsi-meet/resources/prosody-plugins/mod_preset_pass.lua:99: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/modules/muc/muc.lib.lua:489: in function </usr/lib/prosody/modules/muc/muc.lib.lua:431>
	(...tail calls...)
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/stanza_router.lua:180: in function 'core_post_stanza'
	/usr/lib/prosody/core/stanza_router.lua:127: in function 'core_process_stanza'
	/usr/lib/prosody/modules/mod_c2s.lua:275: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

thanx in advance :heartbeat: for any help…!!

Try room:set_subject(“setter_nick”,“subject_name”)

server side is showing success but I am not seeing the subject name change in my client UI?
should I do something else or should it be updated whenever the subject name changes?

Not sure need to check prosody source …

Is there anywhere more I need to look? I mean if I call this function from prosody this should impact all pasrticipant in the room, right? I am becoming cinfused here… As from client side I once saw "subject changed to " - just this, though server side showing subject really changed

just a ping… does this subject/name changing from server/prosody side by default not affect client conference UI (though password seemed working but subject change does not and also confused about becoming moderator moderator) ?
Though I am sure subject/name or being moderator can be set from prosody but how to also notify all the participants about these events? shouldn’t this be done by default?

Yes, clients act on the change …
executing set_subject should notify clients:

What do you pass as “setter_nick” it should be the full room jid of the participant setting it?

yeah I noticed it too that it was broadcasting messages and I also saw client getting messages but nick was nil.
mm I didn’s pass the full jid…!
what should I set as I was planning to set it before even anyone joining - in the hook “muc-room-created” … should I use focus jid in that case or what should I do?

On room created message you can just set the value room._data.subject and that should be enough, I think. All new occupants will get that value.

I will try and make report…! But the function should also work as this does the same inside…!

The funcntion brodcasts a message … but if just jicofo is inside… that’s fine …

I tried but didn’t work. though If I try to change the subject from moderator console, it works :confused: what can I do?

Debug it, on client side do APP.conference.saveLogs() and see do you receive the change of subject …
Or add some prints in prosody to debug it

yeah, I saved the logs and found that there were “subject” tag with my desired subject from server and I also checked that event.room._data - table from server where it was set properly. But for some unknown reason my UI is not getting updated (I set pass+sub from server by mucroom-created hook).
In my APP.store.getState()[‘features/base/conference’] object has no “subject” key but if I set the room subject by APP.conference._room.setSubject() from moderator console then clients seems to acknowledge the subject.
where can the problem lies? Thanx in advance :heartbeat:

as currently in prosody I can use only one table named “prosody” under specific virtual host where the prosody modules under that host can access.
If I modify/add in mod_storage_sql.lua by adding 1-2 more store by which all prosody modules can access that custom mysql table (manually created at first), will that be a problem from the sense of threading/performance?