From 6c56e9cc82bd96622d3b7a0234e3215515b61622 Mon Sep 17 00:00:00 2001 From: Nikolai Zimmermann Date: Sat, 24 Mar 2018 12:22:03 +0100 Subject: [PATCH] Don't add duplicats to message history (#277) --- src/widgets/helper/splitinput.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/helper/splitinput.cpp b/src/widgets/helper/splitinput.cpp index 18ddb6528..3a8a21827 100644 --- a/src/widgets/helper/splitinput.cpp +++ b/src/widgets/helper/splitinput.cpp @@ -144,7 +144,9 @@ void SplitInput::installKeyPressedEvent() sendMessage = sendMessage.replace('\n', ' '); c->sendMessage(sendMessage); - this->prevMsg.append(message); + // don't add duplicate messages to message history + if (this->prevMsg.isEmpty() || !this->prevMsg.endsWith(message)) + this->prevMsg.append(message); event->accept(); if (!(event->modifiers() == Qt::ControlModifier)) {