commit 90e9a0a

grunfink  ·  2025-05-03 17:31:05 +0000 UTC
parent 605b60c
Added back again links as attachments.
1 files changed,  +20, -0
+20, -0
 1@@ -160,6 +160,16 @@ static xs_str *format_line(const char *line, xs_list **attach)
 2                     xs *link = xs_fmt("<a href=\"%s\">%s</a>", url, name);
 3 
 4                     s = xs_str_cat(s, link);
 5+
 6+                    /* also add the link as an attachment */
 7+                    xs *d = xs_dict_new();
 8+
 9+                    d = xs_dict_append(d, "mediaType", "text/html");
10+                    d = xs_dict_append(d, "url",       url);
11+                    d = xs_dict_append(d, "name",      name);
12+                    d = xs_dict_append(d, "type",      "Link");
13+
14+                    *attach = xs_list_append(*attach, d);
15                 }
16                 else
17                     s = xs_str_cat(s, v);
18@@ -243,6 +253,16 @@ static xs_str *format_line(const char *line, xs_list **attach)
19                 else {
20                     xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v2, u);
21                     s = xs_str_cat(s, s1);
22+
23+                    /* also add the link as an attachment */
24+                    xs *d = xs_dict_new();
25+
26+                    d = xs_dict_append(d, "mediaType", "text/html");
27+                    d = xs_dict_append(d, "url",       v2);
28+                    d = xs_dict_append(d, "name",      "");
29+                    d = xs_dict_append(d, "type",      "Link");
30+
31+                    *attach = xs_list_append(*attach, d);
32                 }
33             }
34             else