fix(muc): serialize e2e roominfo as string in disco#info
mod_vnc_e2ehints put the raw boolean returned by get_e2e() (false when unset) into the disco#info roominfo formdata. muc#roominfo_e2e is a text-single field, and util.dataforms/util.stanza cannot serialize a boolean field value, so room:get_disco_info() raised an error and the server silently dropped the disco#info reply for every existing room (confirmed at the wire level: non-existent rooms returned item-not-found, existing rooms returned nothing). Coerce the value to a string, matching the working mod_vnc_muc_data pattern. get_e2e() itself is left returning a boolean since the muc-config-form boolean field needs it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Part-of: <http://gitlab.vnc.biz/uxf/vnctalk-prosody/-/merge_requests/3>
This commit is contained in:
@@ -50,5 +50,10 @@ module:hook("muc-disco#info", function (event)
|
||||
table.insert(form, {
|
||||
name = "muc#roominfo_e2e",
|
||||
});
|
||||
formdata["muc#roominfo_e2e"] = e2e;
|
||||
-- formdata values must be strings: this is a text-single field (no type),
|
||||
-- and util.dataforms/util.stanza cannot serialize a raw boolean as a
|
||||
-- field value. get_e2e() returns a boolean (false when unset), so an
|
||||
-- unconverted value broke room:get_disco_info() for every existing room
|
||||
-- and the server silently dropped the disco#info reply.
|
||||
formdata["muc#roominfo_e2e"] = tostring(e2e);
|
||||
end);
|
||||
|
||||
Reference in New Issue
Block a user