Replace newlines with spaces

This commit is contained in:
Rasmus Karlsson 2017-08-12 12:24:28 +02:00
parent 6baf045c4c
commit 7ce1458348

View file

@ -57,8 +57,11 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget)
if (c == nullptr) { if (c == nullptr) {
return; return;
} }
c->sendMessage(textInput.toPlainText()); QString message = textInput.toPlainText();
prevMsg.append(textInput.toPlainText());
c->sendMessage(message.replace('\n', ' '));
prevMsg.append(message);
event->accept(); event->accept();
if (!(event->modifiers() == Qt::ControlModifier)) { if (!(event->modifiers() == Qt::ControlModifier)) {
textInput.setText(QString()); textInput.setText(QString());