diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -2193,7 +2193,8 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2193 | /* show all hashtags that has not been shown previously in the content */ | 2193 | /* show all hashtags that has not been shown previously in the content */ |
| 2194 | const xs_list *tags = xs_dict_get(msg, "tag"); | 2194 | const xs_list *tags = xs_dict_get(msg, "tag"); |
| 2195 | if (xs_type(tags) == XSTYPE_LIST && xs_list_len(tags)) { | 2195 | if (xs_type(tags) == XSTYPE_LIST && xs_list_len(tags)) { |
| 2196 | const char *content = xs_dict_get(msg, "content"); | 2196 | const char *o_content = xs_dict_get(msg, "content"); |
| 2197 | xs *content = xs_utf8_to_lower(o_content); | ||
| 2197 | const xs_dict *tag; | 2198 | const xs_dict *tag; |
| 2198 | 2199 | ||
| 2199 | xs_html *add_hashtags = xs_html_tag("ul", | 2200 | xs_html *add_hashtags = xs_html_tag("ul", |
| @@ -2203,12 +2204,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2203 | const char *type = xs_dict_get(tag, "type"); | 2204 | const char *type = xs_dict_get(tag, "type"); |
| 2204 | 2205 | ||
| 2205 | if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) { | 2206 | if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) { |
| 2206 | const char *href = xs_dict_get(tag, "href"); | 2207 | const char *o_href = xs_dict_get(tag, "href"); |
| 2207 | xs *lc_href = xs_utf8_to_lower(href); | 2208 | xs *href = xs_utf8_to_lower(o_href); |
| 2208 | 2209 | ||
| 2209 | if (xs_type(href) == XSTYPE_STRING && | 2210 | if (xs_type(href) == XSTYPE_STRING && xs_str_in(content, href) == -1) { |
| 2210 | xs_str_in(content, href) == -1 && | ||
| 2211 | xs_str_in(content, lc_href) == -1) { | ||
| 2212 | /* not in the content: add here */ | 2211 | /* not in the content: add here */ |
| 2213 | const char *name = xs_dict_get(tag, "name"); | 2212 | const char *name = xs_dict_get(tag, "name"); |
| 2214 | 2213 | ||