aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Matrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Matrix.cpp')
-rw-r--r--src/plugins/Matrix.cpp14
1 files changed, 1 insertions, 13 deletions
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;