From 7ce145834819c5dbf7fdfb06a6d25e6959ca094f Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 12 Aug 2017 12:24:28 +0200 Subject: [PATCH] Replace newlines with spaces --- src/widgets/chatwidgetinput.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/chatwidgetinput.cpp b/src/widgets/chatwidgetinput.cpp index d72d806d..987d0a5f 100644 --- a/src/widgets/chatwidgetinput.cpp +++ b/src/widgets/chatwidgetinput.cpp @@ -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());