commit 2ca7735
shtrophic
·
2025-02-19 07:56:14 +0000 UTC
parent 7eb2556
fix ownership-problem of mailinfo
3 files changed,
+5,
-4
+1,
-1
1@@ -1025,7 +1025,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor,
2 "\n",
3 from, email, subject);
4
5- xs *mailinfo = xs_dict_new();
6+ xs_dict *mailinfo = xs_dict_new();
7 xs_dict_append(mailinfo, "from", from);
8 xs_dict_append(mailinfo, "to", email);
9 xs_dict_append(mailinfo, "body", xs_fmt("%s%s", header, body));
M
data.c
+3,
-2
1@@ -3174,7 +3174,7 @@ static xs_dict *_enqueue_put(const char *fn, xs_dict *msg)
2 }
3
4
5-static xs_dict *_new_qmsg(const char *type, const xs_val *msg, int retries)
6+static xs_dict *_new_qmsg(const char *type, xs_dict *msg, int retries)
7 /* creates a queue message */
8 {
9 int qrt = xs_number_get(xs_dict_get(srv_config, "queue_retry_minutes"));
10@@ -3276,9 +3276,10 @@ void enqueue_output_by_actor(snac *snac, const xs_dict *msg,
11 }
12
13
14-void enqueue_email(const xs_dict *msg, int retries)
15+void enqueue_email(xs_dict *msg, int retries)
16 /* enqueues an email message to be sent */
17 {
18+ /* qmsg owns msg */
19 xs *qmsg = _new_qmsg("email", msg, retries);
20 const char *ntid = xs_dict_get(qmsg, "ntid");
21 xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid);
M
snac.h
+1,
-1
1@@ -274,7 +274,7 @@ void enqueue_output(snac *snac, const xs_dict *msg,
2 const xs_str *inbox, int retries, int p_status);
3 void enqueue_output_by_actor(snac *snac, const xs_dict *msg,
4 const xs_str *actor, int retries);
5-void enqueue_email(const xs_str *msg, int retries);
6+void enqueue_email(xs_dict *msg, int retries);
7 void enqueue_telegram(const xs_str *msg, const char *bot, const char *chat_id);
8 void enqueue_ntfy(const xs_str *msg, const char *ntfy_server, const char *ntfy_token);
9 void enqueue_message(snac *snac, const xs_dict *msg);