Lobby affiliation changes trigger empty system message popup boxes
When one changes the affiliation of a user in the room (psi-plus -> configure room -> banlist -> add or remove an entry -> apply), then (as of r21931):
- every player in the lobby gets a a popup with an empty message and a "Private" empty chat message
- affiliation changes are frequent, players are annoyed and annoy moderators with bugreports about this phenomenon
- r20005 displayed these messages when announcement support was added
- r21916 acknowledged the possibility of empty private system messages, but did not discover the relation to affiliation changes
- In Phab:rP21916#31564 we noticed the relation to bannign
XmppClient::handleMUCMessage
is called with empty msg.from().resource()
, empty msg.body()
, msg.subtype() = 16 = gloox::Message::Normal
(excluding the gloox::Message::Chat
flag) and priv = true
- gloox'
MUCRoom::handleMessage
is the only function that calls this handleMUCMessage
function.
- Perhaps the line
if( msg.subtype() & ( Message::Chat | Message::Normal ) ) privMsg = true;
in that function has a different intended meaning than the boolean logic implements
- Since
if( !msg.body().empty() || !msg.extensions().empty() )
must be true and the body is claimed to be empty, the extensions()
list should be considered.
It sounds like all StanzaExtensions defined in stanzaextension.h
arrive here but are not parsed.
- Changing the semi-anonymous anonymous room (real JID revelation) setting also shows a non-private room message without from
- The popup does not occur if the room is configured as semi-anonymous.
- r21925 recommends to use the non-anonymous room and the WFG arena23 lobby room was made non-anonymous shortly before on Nov 01st 2018. This however does not explain how the empty popup occured shortly before then (r21916) already.
- Perhaps the README (or XMPP specs?) should be updated with regards to the semi-anonymous room setting, if it not only shows the real JIDs but also affiliation changes and possibly many more information conditionally in the StanzaExtensions
Following #4482 / r22856 one can pass arbitrary JS properties to the JS GUI messages.
Following
GlooxScriptConversions.cpp
from r22891, the gloox enum values translated to JS strings are passed as such an arbitrary (additional) JS GUI property.One can do the same for the messages and muc messages, i.e. extend the current information instead of having to try to parse the
from
field to see what type of message that was.So the JS side will be able to distinguish well the gloox chat message based on the gloox enum value.
If one adds someone to the banlist in psi+ and clicks on save, the xmpp server sends the following message (captured with wireshark):
Upon unban:
Currently the XMPP server only receives a message with empty subject and empty body, hence the useless empty popup.