Don't add duplicats to message history (#277)

This commit is contained in:
Nikolai Zimmermann 2018-03-24 12:22:03 +01:00 committed by pajlada
parent b2f041989c
commit 6c56e9cc82

View file

@ -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)) {