List reason for role change in MUC

Shows the reason for the role change in the status message. This is
mostly relevant for communicating the reason and possibly duration for a
moderator or bot muting a user.

Refs: #5679
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2026-01-04 20:31:45 +01:00
parent 5255b919d9
commit d070bf66b3
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -94,6 +94,9 @@ ChatMessageEvents.Role = class
txt = sprintf(roleType.nick, this.args);
}
if (message.reason)
txt = sprintf(translate("%(rolechangemessage)s Reason: %(reason)s"), { "rolechangemessage": txt, "reason": message.reason });
this.chatMessagesPanel.addText(
message.time,
this.statusMessageFormat.format(txt));

View file

@ -1110,7 +1110,8 @@ void XmppClient::handleMUCParticipantPresence(gloox::MUCRoom*, const gloox::MUCR
std::time(nullptr),
"nick", nick,
"oldrole", it->second.m_Role,
"newrole", participant.role);
"newrole", participant.role,
"reason", participant.reason);
}
else
{