#384 mod_privacy_lists: User gets kicked from room if they block an MUC occupant's room JID
*What steps will reproduce the problem?*
1. Login with two users (A@example.com, B@example.com) & have them in the same room (email@example.com/A, firstname.lastname@example.org/B)
In my UC, B is the current owner of the room. I guess (but didn't test it) if B is not the owner, or A is the owner, it doesn't happen.
2. Create privacy list "ignore" for user A & add user B to it:
Result from getting the current privacy list for A:
<iq id='3:sendIQ' type='result' to='A@example.com/Candy'>
<item email@example.com/B' type='jid' action='deny' order='0'><message/></item>
3. With User B, whisper to A (in the muc room):
<message firstname.lastname@example.org/A' from='B@example.com/Candy' type='chat' id='msg:10' xmlns='jabber:client'>
4. User A will be kicked out of room email@example.com without receiving message TEST:
<presence type='unavailable' to='A@example.com/Candy' firstname.lastname@example.org/A'>
<status>Kicked: service unavailable</status>
<item affiliation='none' role='none'/>
*What is the expected output? What do you see instead?*
User A should just not receive the message from B.
*What version of the product are you using? On what operating system?*
Prosody 0.9.1, OSX 10.9
Debug info from prosody.log:
Jan 17 16:58:30 mod_muc debug B@example.com/Candy sent private stanza to email@example.com/A (A@example.com/Candy)
Jan 17 16:58:30 localhost:privacy debug stanza blocked: message, to: A@example.com/Candy, from: firstname.lastname@example.org/B
Jan 17 16:58:30 mod_muc debug room: email@example.com, current_nick: firstname.lastname@example.org/A, stanza: <message id='msg:10' type='error' email@example.com/B' from='A@example.com/Candy'>
Jan 17 16:58:30 mod_muc debug firstname.lastname@example.org/A kicked from email@example.com for sending an error message
Jan 17 16:58:30 mod_muc debug room: firstname.lastname@example.org, current_nick: email@example.com/A, stanza: <presence type='unavailable' firstname.lastname@example.org/B' from='A@conference.example.com/Candy'>
Jan 17 16:58:30 mod_muc debug email@example.com/A leaving firstname.lastname@example.org
Hi, thanks for bringing up this issue.
It's something of a specification bug in my opinion, but we need to look into workarounds.
I'm marking it for 0.9, but if the solution requires major changes it may get pushed to 0.10.
mod_privacy was removed from 0.10 but the replacement, mod_blocklist, has the same dilemma. Currently I believe you get kicked if someone you blocked sends you a PM.
This is unlikely to get fixed in Prosody. Let this refer to mod_privacy_lists in prosody-modules, where mod_privacy was moved to.
title[mod_muc/mod_privacy] User gets kicked from room if they block an occupant's room JID
I still think this is an unfortunate spec bug, but I have a couple of proposals we could consider.
Option #1: For stanzas addressed to a valid full JID (i.e. session is online), do not send service-unavailable.
Option #2: Apply the above logic only if the stanza has a MUC <x> payload (some MUC services do not currently send this, so it wouldn't be a 100% fix until they do).