Skip to content
Snippets Groups Projects
Commit 6c31bb6d authored by LordMZTE's avatar LordMZTE
Browse files

fix command parsing

parent ff2e7bb9
No related branches found
No related tags found
No related merge requests found
Pipeline #938 failed
......@@ -15,6 +15,7 @@
#include <mtx/responses/common.hpp>
#include <mtx/responses/media.hpp>
#include <QRegExp>
#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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment