From dd1beb1d916e8797ca68a70471f4b89b1c3d6c90 Mon Sep 17 00:00:00 2001 From: Patrick Eigensatz Date: Sun, 18 Feb 2018 15:28:36 +0100 Subject: [PATCH] Let emoji suggestions be case insensitive Closes #3985 --- .../SourceFiles/chat_helpers/emoji_suggestions_widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp index d220786683..ea61652c71 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp @@ -401,7 +401,7 @@ QString SuggestionsController::getEmojiQuery() { } position -= from; _queryStartPosition = from; - return fragment.text(); + return fragment.text().toLower(); } return QString(); }; @@ -412,7 +412,7 @@ QString SuggestionsController::getEmojiQuery() { } auto isSuggestionChar = [](QChar ch) { - return (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || (ch == '_') || (ch == '-') || (ch == '+'); + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_') || (ch == '-') || (ch == '+'); }; auto isGoodCharBeforeSuggestion = [isSuggestionChar](QChar ch) { return !isSuggestionChar(ch) || (ch == 0);