1
0
Fork 0
mirror of https://github.com/Chatterino/chatterino2.git synced 2024-11-21 22:24:07 +01:00

Don't add duplicats to message history ()

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