From 78fce9e810e48095be9d1a81a31df49db9a4d5b3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 9 Jun 2021 16:41:10 +0200 Subject: Show critical notification before abort on critical error --- src/plugins/Matrix.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/plugins/Matrix.cpp') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 6c7e4bd..89c9984 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -1957,18 +1957,6 @@ namespace QuickMedia { return false; } - static size_t string_find_case_insensitive(const char *haystack, size_t index, size_t length, const std::string &needle) { - const char *haystack_end = haystack + length; - auto it = std::search(haystack + index, haystack_end, needle.begin(), needle.end(), - [](char c1, char c2) { - return std::toupper(c1) == std::toupper(c2); - }); - if(it != haystack_end) - return it - haystack; - else - return std::string::npos; - } - // TODO: Do not show notification if mention is a reply to somebody else that replies to me? also dont show notification everytime a mention is edited bool message_contains_user_mention(const std::string &msg, const std::string &username) { if(msg.empty() || username.empty()) @@ -1976,7 +1964,7 @@ namespace QuickMedia { size_t index = 0; while(index < msg.size()) { - size_t found_index = string_find_case_insensitive(&msg[0], index, msg.size(), username); + size_t found_index = str_find_case_insensitive(msg, index, username.c_str(), username.size()); if(found_index == std::string::npos) break; -- cgit v1.2.3