Correctly hide avatar and name change events when configured

This commit is contained in:
Tobias Fella
2022-11-10 14:53:39 +01:00
parent 962a1b228c
commit 95345973cb
4 changed files with 39 additions and 2 deletions

View File

@@ -518,14 +518,14 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
return text;
}
// Part 2: profile changes of joined members
if (e.isRename() && NeoChatConfig::self()->showRename()) {
if (e.isRename()) {
if (e.displayName().isEmpty()) {
text = i18nc("their refers to a singular user", "cleared their display name");
} else {
text = i18nc("their refers to a singular user", "changed their display name to %1", e.displayName().toHtmlEscaped());
}
}
if (e.isAvatarUpdate() && NeoChatConfig::self()->showAvatarUpdate()) {
if (e.isAvatarUpdate()) {
if (!text.isEmpty()) {
text += i18n(" and ");
}