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,6 +144,8 @@ void SplitInput::installKeyPressedEvent()
sendMessage = sendMessage.replace('\n', ' '); sendMessage = sendMessage.replace('\n', ' ');
c->sendMessage(sendMessage); c->sendMessage(sendMessage);
// don't add duplicate messages to message history
if (this->prevMsg.isEmpty() || !this->prevMsg.endsWith(message))
this->prevMsg.append(message); this->prevMsg.append(message);
event->accept(); event->accept();