Software /
code /
prosody
Diff
plugins/muc/muc.lib.lua @ 7383:69827ee1f951
MUC: Accept missing form as "instant room" request (fixes #377)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 19 Apr 2016 17:20:39 +0200 |
parent | 7011:2d5751b2f21c |
child | 7385:17929cdacec2 |
child | 8465:0ec72e67f797 |
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua Sun Apr 03 15:18:21 2016 +0200 +++ b/plugins/muc/muc.lib.lua Tue Apr 19 17:20:39 2016 +0200 @@ -668,6 +668,14 @@ if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end + if form.tags[1] == nil then + -- instant room + if self.save then self:save(true); end + origin.send(st.reply(stanza)); + return true; + end + + local fields = self:get_form_layout():data(form); if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); return; end