aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-05-03 19:31:05 +0200
committergrunfink <grunfink@comam.es>2025-05-03 19:31:05 +0200
commit90e9a0aeef500f11528a326ee676caa7da5ef2db (patch)
treea781d0395f0da5529fa2acfad989b0967621b982 /format.c
parent605b60c06ea882cd61df7f2d834c02cce6dd254d (diff)
Added back again links as attachments.
Diffstat (limited to 'format.c')
-rw-r--r--format.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/format.c b/format.c
index f5c66da..525edb0 100644
--- a/format.c
+++ b/format.c
@@ -160,6 +160,16 @@ static xs_str *format_line(const char *line, xs_list **attach)
xs *link = xs_fmt("<a href=\"%s\">%s</a>", url, name);
s = xs_str_cat(s, link);
+
+ /* also add the link as an attachment */
+ xs *d = xs_dict_new();
+
+ d = xs_dict_append(d, "mediaType", "text/html");
+ d = xs_dict_append(d, "url", url);
+ d = xs_dict_append(d, "name", name);
+ d = xs_dict_append(d, "type", "Link");
+
+ *attach = xs_list_append(*attach, d);
}
else
s = xs_str_cat(s, v);
@@ -243,6 +253,16 @@ static xs_str *format_line(const char *line, xs_list **attach)
else {
xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v2, u);
s = xs_str_cat(s, s1);
+
+ /* also add the link as an attachment */
+ xs *d = xs_dict_new();
+
+ d = xs_dict_append(d, "mediaType", "text/html");
+ d = xs_dict_append(d, "url", v2);
+ d = xs_dict_append(d, "name", "");
+ d = xs_dict_append(d, "type", "Link");
+
+ *attach = xs_list_append(*attach, d);
}
}
else