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) {
return;
}
c->sendMessage(textInput.toPlainText());
prevMsg.append(textInput.toPlainText());
QString message = textInput.toPlainText();
c->sendMessage(message.replace('\n', ' '));
prevMsg.append(message);
event->accept();
if (!(event->modifiers() == Qt::ControlModifier)) {
textInput.setText(QString());