summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-01-08 17:20:53 +0100
committerGravatar default2025-01-08 17:20:53 +0100
commitb51085831e40dbcbd5ff80e033c1b59702cbc920 (patch)
treee5f59d3bc28c300bde6b55382230ba569a15c0a7
parentBumped copyright year. (diff)
downloadpenes-snac2-b51085831e40dbcbd5ff80e033c1b59702cbc920.tar.gz
penes-snac2-b51085831e40dbcbd5ff80e033c1b59702cbc920.tar.xz
penes-snac2-b51085831e40dbcbd5ff80e033c1b59702cbc920.zip
Also check for the lowecase URL of the hashtags.
-rw-r--r--Makefile3
-rw-r--r--Makefile.NetBSD3
-rw-r--r--html.c6
3 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8aa2ca9..75d9562 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,8 @@ data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
42format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \ 42format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
43 xs_time.h xs_match.h snac.h http_codes.h 43 xs_time.h xs_match.h snac.h http_codes.h
44html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \ 44html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
45 xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h snac.h http_codes.h 45 xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h xs_unicode.h snac.h \
46 http_codes.h
46http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \ 47http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
47 snac.h http_codes.h 48 snac.h http_codes.h
48httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \ 49httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
diff --git a/Makefile.NetBSD b/Makefile.NetBSD
index 20cf28b..f14eb6e 100644
--- a/Makefile.NetBSD
+++ b/Makefile.NetBSD
@@ -44,7 +44,8 @@ data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
44format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \ 44format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
45 xs_time.h xs_match.h snac.h http_codes.h 45 xs_time.h xs_match.h snac.h http_codes.h
46html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \ 46html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
47 xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h snac.h http_codes.h 47 xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h xs_unicode.h snac.h \
48 http_codes.h
48http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \ 49http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
49 snac.h http_codes.h 50 snac.h http_codes.h
50httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \ 51httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
diff --git a/html.c b/html.c
index 5a62d16..bade62a 100644
--- a/html.c
+++ b/html.c
@@ -12,6 +12,7 @@
12#include "xs_match.h" 12#include "xs_match.h"
13#include "xs_html.h" 13#include "xs_html.h"
14#include "xs_curl.h" 14#include "xs_curl.h"
15#include "xs_unicode.h"
15 16
16#include "snac.h" 17#include "snac.h"
17 18
@@ -2203,8 +2204,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2203 2204
2204 if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) { 2205 if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) {
2205 const char *href = xs_dict_get(tag, "href"); 2206 const char *href = xs_dict_get(tag, "href");
2207 xs *lc_href = xs_utf8_to_lower(href);
2206 2208
2207 if (xs_type(href) == XSTYPE_STRING && xs_str_in(content, href) == -1) { 2209 if (xs_type(href) == XSTYPE_STRING &&
2210 xs_str_in(content, href) == -1 &&
2211 xs_str_in(content, lc_href) == -1) {
2208 /* not in the content: add here */ 2212 /* not in the content: add here */
2209 const char *name = xs_dict_get(tag, "name"); 2213 const char *name = xs_dict_get(tag, "name");
2210 2214