# HG changeset patch # User Kim Alvefur # Date 1747672915 -7200 # Node ID 4e109e917f892f0654269aad1152fd0e07862192 # Parent bfa8ac5881a01f84f03959a22585ffde777c47f4# Parent 3609d8fcad0062833e3a1472690fb786d1133c9f Merge 13.0->trunk diff -r bfa8ac5881a0 -r 4e109e917f89 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Tue May 13 22:38:34 2025 +0200 +++ b/plugins/muc/mod_muc.lua Mon May 19 18:41:55 2025 +0200 @@ -104,6 +104,7 @@ local jid_split = require "prosody.util.jid".split; local jid_prep = require "prosody.util.jid".prep; local jid_bare = require "prosody.util.jid".bare; +local jid_resource = require "prosody.util.jid".resource; local st = require "prosody.util.stanza"; local cache = require "prosody.util.cache"; @@ -441,6 +442,13 @@ end end); +local function is_join_presence(stanza) + return stanza.name == "presence" + and stanza.attr.type == nil + and jid_resource(stanza.attr.to) ~= nil + and stanza:get_child("x", "http://jabber.org/protocol/muc"); +end + for event_name, method in pairs { -- Normal room interactions ["iq-get/bare/http://jabber.org/protocol/disco#info:query"] = "handle_disco_info_get_query" ; @@ -496,7 +504,7 @@ origin.send(st.error_reply(stanza, "modify", "jid-malformed", nil, module.host)); return true; end - if stanza.attr.type == nil and stanza.name == "presence" and stanza:get_child("x", "http://jabber.org/protocol/muc") then + if is_join_presence(stanza) then room = muclib.new_room(room_jid); return room:handle_first_presence(origin, stanza); elseif stanza.attr.type ~= "error" then diff -r bfa8ac5881a0 -r 4e109e917f89 spec/scansion/muc_create_destroy.scs --- a/spec/scansion/muc_create_destroy.scs Tue May 13 22:38:34 2025 +0200 +++ b/spec/scansion/muc_create_destroy.scs Mon May 19 18:41:55 2025 +0200 @@ -17,6 +17,14 @@ Romeo connects Romeo sends: + + + + +Romeo receives: + + +Romeo sends: