commit 066ce90

default  ·  2024-12-30 22:03:40 +0000 UTC
parent 03b5954
Convert to lowercase when checking for followed hashtags.
1 files changed,  +7, -2
+7, -2
 1@@ -10,6 +10,7 @@
 2 #include "xs_time.h"
 3 #include "xs_set.h"
 4 #include "xs_match.h"
 5+#include "xs_unicode.h"
 6 
 7 #include "snac.h"
 8 
 9@@ -720,8 +721,12 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
10                     const char *name = xs_dict_get(te, "name");
11 
12                     if (xs_type(type) == XSTYPE_STRING && xs_type(name) == XSTYPE_STRING) {
13-                        if (strcmp(type, "Hashtag") == 0 && xs_list_in(fw_tags, name) != -1)
14-                            return 7;
15+                        if (strcmp(type, "Hashtag") == 0) {
16+                            xs *lc_name = xs_utf8_to_lower(name);
17+
18+                            if (xs_list_in(fw_tags, lc_name) != -1)
19+                                return 7;
20+                        }
21                     }
22                 }
23             }