aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-11-07 22:01:03 +0100
committerdefault <nobody@localhost>2024-11-07 22:01:03 +0100
commitb2555fb6b92a984b182d56998608b66f19e9ed91 (patch)
tree1cd861d3b766cf2f9124b329f08dda5bae6bbb64
parent585adead38b5a8ec543cc6fcc990b0d1ef4d62ba (diff)
parentc7e8f3783bd77e22755f958faa0cff03424f00ef (diff)
Merge branch 'master' of comam.es:git/snac2
-rw-r--r--data.c16
-rw-r--r--html.c16
-rw-r--r--snac.h2
3 files changed, 18 insertions, 16 deletions
diff --git a/data.c b/data.c
index b3788e2..c119360 100644
--- a/data.c
+++ b/data.c
@@ -3650,3 +3650,19 @@ t_announcement *announcement(const double after)
return NULL;
}
+
+
+xs_str *make_url(const char *href, const char *proxy)
+/* makes an URL, possibly including proxying */
+{
+ xs_str *url = NULL;
+
+ if (proxy && !xs_startswith(href, srv_baseurl)) {
+ xs *p = xs_str_cat(xs_dup(proxy), "/proxy/");
+ url = xs_replace(href, "https:/" "/", p);
+ }
+ else
+ url = xs_dup(href);
+
+ return url;
+}
diff --git a/html.c b/html.c
index c75b4fe..3721f0e 100644
--- a/html.c
+++ b/html.c
@@ -42,22 +42,6 @@ int login(snac *snac, const xs_dict *headers)
}
-xs_str *make_url(const char *href, const char *proxy)
-/* makes an URL, possibly including proxying */
-{
- xs_str *url = NULL;
-
- if (proxy && !xs_startswith(href, srv_baseurl)) {
- xs *p = xs_str_cat(xs_dup(proxy), "/proxy/");
- url = xs_replace(href, "https:/" "/", p);
- }
- else
- url = xs_dup(href);
-
- return url;
-}
-
-
xs_str *replace_shortnames(xs_str *s, const xs_list *tag, int ems, const char *proxy)
/* replaces all the :shortnames: with the emojis in tag */
{
diff --git a/snac.h b/snac.h
index 3c3b044..aa53838 100644
--- a/snac.h
+++ b/snac.h
@@ -409,3 +409,5 @@ typedef struct {
char *text;
} t_announcement;
t_announcement *announcement(double after);
+
+xs_str *make_url(const char *href, const char *proxy);