# HG changeset patch # User Jonas Schäfer # Date 1640174792 -3600 # Node ID 0b14b541fd277665956be9687d79f2a49a1db36e # Parent b344edad61d3906e235cee988f27c01bc2a541c7 mod_roster: pass correct username to roster-item-removed The other invocations use it that way, and the only listener in trunk which uses it (in mod_presence) expects it that way. Passing the username of the JID from the removed entry causes incorrect unavailable presence stanzas to be sent, allegedly kicking people off MUCs. Fixes #1121. diff -r b344edad61d3 -r 0b14b541fd27 plugins/mod_roster.lua --- a/plugins/mod_roster.lua Wed Dec 22 14:24:26 2021 +0100 +++ b/plugins/mod_roster.lua Wed Dec 22 13:06:32 2021 +0100 @@ -74,7 +74,7 @@ local r_item = roster[jid]; if r_item then module:fire_event("roster-item-removed", { - username = node, jid = jid, item = r_item, origin = session, roster = roster, + username = from_node, jid = jid, item = r_item, origin = session, roster = roster, }); local success, err_type, err_cond, err_msg = rm_remove_from_roster(session, jid); if success then diff -r b344edad61d3 -r 0b14b541fd27 spec/scansion/issue1121.scs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/scansion/issue1121.scs Wed Dec 22 13:06:32 2021 +0100 @@ -0,0 +1,75 @@ +# When removing roster contact, Prosody should send directed "unavailable" presence but sends global unavailable presence + +[Client] Romeo + jid: romeo@localhost + password: password + +[Client] Juliet + jid: juliet@localhost + password: password + +----- + +Romeo connects + +Romeo sends + + +Romeo receives + + +Juliet connects + +Juliet sends + + +Juliet receives + + +Romeo sends + + +Romeo receives + + +Juliet receives + + +Juliet sends + + +Romeo receives + + +Juliet sends + + +Juliet receives + + +Romeo receives + + +Romeo sends + + +Juliet receives + + +Romeo receives + + +Juliet sends + + + + + + +Juliet receives + + +Romeo receives + + +Romeo disconnects