From 89a60ceea8a087a17139a411097c3e126bccb998 Mon Sep 17 00:00:00 2001 From: TranRed Date: Sun, 25 Aug 2019 10:02:26 +0200 Subject: [PATCH] turned QString::compare() call into a bool create self-similarity with bool isMyself further up in the class implementation --- src/widgets/dialogs/UserInfoPopup.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index d99070f94..4a8813b47 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -554,7 +554,6 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget() addButton(Unban, "unban", getApp()->resources->buttons.unban); - const auto timeoutButtons = getSettings()->timeoutButtons.getValue(); std::vector> t(8); // Timeouts. auto i = 0; @@ -589,8 +588,11 @@ void UserInfoPopup::fillLatestMessages() for (size_t i = 0; i < snapshot.size(); i++) { MessagePtr message = snapshot[i]; - if (!message->loginName.compare(this->userName_, Qt::CaseInsensitive) && - !message->flags.has(MessageFlag::Whisper)) + + bool isSelectedUser = message->loginName.compare( + this->userName_, Qt::CaseInsensitive) == 0; + + if (isSelectedUser && !message->flags.has(MessageFlag::Whisper)) { channelPtr->addMessage(message); }