From 6c31bb6ddc88b5eccf2c24b47044da485231d002 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sun, 28 Mar 2021 15:36:46 +0200 Subject: [PATCH] fix command parsing --- src/timeline/InputBar.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 2e311169..d7db50a9 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -15,6 +15,7 @@ #include #include +#include #include "Cache.h" #include "ChatPage.h" @@ -203,9 +204,7 @@ InputBar::send() auto wasEdit = !room->edit().isEmpty(); if (text().startsWith('/')) { - int command_end = text().indexOf(' '); - if (command_end == -1) - command_end = text().indexOf('\n'); + int command_end = text().indexOf(QRegExp("\\s+")); if (command_end == -1) command_end = text().size(); auto name = text().mid(1, command_end - 1);