Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 9647:0f43b901c854
MUC: Move check for explicit room join earlier in room creation flow
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 27 Nov 2018 17:01:47 +0100 |
| parent | 9641:0ce404230388 |
| child | 9717:537f6a27bdb6 |
comparison
equal
deleted
inserted
replaced
| 9646:eb543e4a47e2 | 9647:0f43b901c854 |
|---|---|
| 426 return true; | 426 return true; |
| 427 end | 427 end |
| 428 end, 1); | 428 end, 1); |
| 429 | 429 |
| 430 function room_mt:handle_first_presence(origin, stanza) | 430 function room_mt:handle_first_presence(origin, stanza) |
| 431 if not stanza:get_child("x", "http://jabber.org/protocol/muc") then | |
| 432 module:log("debug", "Room creation without <x>, possibly desynced"); | |
| 433 | |
| 434 origin.send(st.error_reply(stanza, "cancel", "item-not-found")); | |
| 435 return true; | |
| 436 end | |
| 437 | |
| 438 local real_jid = stanza.attr.from; | 431 local real_jid = stanza.attr.from; |
| 439 local dest_jid = stanza.attr.to; | 432 local dest_jid = stanza.attr.to; |
| 440 local bare_jid = jid_bare(real_jid); | 433 local bare_jid = jid_bare(real_jid); |
| 441 if module:fire_event("muc-room-pre-create", { | 434 if module:fire_event("muc-room-pre-create", { |
| 442 room = self; | 435 room = self; |