diff options
-rw-r--r-- | src/gui/chat.cpp | 3 | ||||
-rw-r--r-- | src/utils/stringutils.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index ada7ab16..b7c02283 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -548,6 +548,9 @@ void ChatWindow::autoComplete() if (newName != "") { + if(inputText[0] == '@' || inputText[0] == '/') + newName = "\"" + newName + "\""; + mChatInput->setText(inputText.substr(0, startName) + newName + inputText.substr(caretPos, inputText.length() - caretPos)); diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 996be29d..1c10d086 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -143,7 +143,7 @@ int compareStrI(const std::string &a, const std::string &b) bool isWordSeparator(char chr) { - return (chr == ' ' || chr == ',' || chr == '.'); + return (chr == ' ' || chr == ',' || chr == '.' || chr == '"'); } const std::string findSameSubstring(const std::string &str1, const std::string &str2) |