Don't add empty messages to message history. (#674)

This commit is contained in:
23rd 2018-08-22 01:57:44 +03:00 committed by pajlada
parent a07255be2d
commit be4b3f1a38

View file

@ -176,8 +176,9 @@ 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 // don't add duplicate messages and empty message to message history
if (this->prevMsg_.isEmpty() || !this->prevMsg_.endsWith(message)) if ((this->prevMsg_.isEmpty() || !this->prevMsg_.endsWith(message)) &&
!message.trimmed().isEmpty())
this->prevMsg_.append(message); this->prevMsg_.append(message);
event->accept(); event->accept();