From ee0334acc55215ed8e94bae8fa4ff8976834af20 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Mon, 14 Feb 2022 02:35:02 -0800 Subject: [PATCH] feat(chatlog): Disable join and leave system messages based on setting Backported from 069ab92fd013b915855723f20ac72ad30838d325 --- src/widget/form/groupchatform.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 3795a4f36..ba5fc15cc 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -235,13 +235,17 @@ void GroupChatForm::updateUserNames() void GroupChatForm::onUserJoined(const ToxPk& user, const QString& name) { - addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + if (settings.getShowGroupJoinLeaveMessages()) { + addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + } updateUserNames(); } void GroupChatForm::onUserLeft(const ToxPk& user, const QString& name) { - addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + if (settings.getShowGroupJoinLeaveMessages()) { + addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + } updateUserNames(); }