snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 59a34a9646e28cc9a63194ff55547de0005d0110
parent 2ca7735779e79dbe6fe62f0111a12c145f428d8f
Author: shtrophic <christoph@liebender.dev>
Date:   Thu, 20 Feb 2025 17:13:12 +0100

Revert "fix ownership-problem of mailinfo"

This reverts commit 2ca7735779e79dbe6fe62f0111a12c145f428d8f.

Diffstat:
Mactivitypub.c | 2+-
Mdata.c | 5++---
Msnac.h | 2+-
3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/activitypub.c b/activitypub.c @@ -1025,7 +1025,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, "\n", from, email, subject); - xs_dict *mailinfo = xs_dict_new(); + xs *mailinfo = xs_dict_new(); xs_dict_append(mailinfo, "from", from); xs_dict_append(mailinfo, "to", email); xs_dict_append(mailinfo, "body", xs_fmt("%s%s", header, body)); diff --git a/data.c b/data.c @@ -3174,7 +3174,7 @@ static xs_dict *_enqueue_put(const char *fn, xs_dict *msg) } -static xs_dict *_new_qmsg(const char *type, xs_dict *msg, int retries) +static xs_dict *_new_qmsg(const char *type, const xs_val *msg, int retries) /* creates a queue message */ { int qrt = xs_number_get(xs_dict_get(srv_config, "queue_retry_minutes")); @@ -3276,10 +3276,9 @@ void enqueue_output_by_actor(snac *snac, const xs_dict *msg, } -void enqueue_email(xs_dict *msg, int retries) +void enqueue_email(const xs_dict *msg, int retries) /* enqueues an email message to be sent */ { - /* qmsg owns msg */ xs *qmsg = _new_qmsg("email", msg, retries); const char *ntid = xs_dict_get(qmsg, "ntid"); xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid); diff --git a/snac.h b/snac.h @@ -274,7 +274,7 @@ void enqueue_output(snac *snac, const xs_dict *msg, const xs_str *inbox, int retries, int p_status); void enqueue_output_by_actor(snac *snac, const xs_dict *msg, const xs_str *actor, int retries); -void enqueue_email(xs_dict *msg, int retries); +void enqueue_email(const xs_str *msg, int retries); void enqueue_telegram(const xs_str *msg, const char *bot, const char *chat_id); void enqueue_ntfy(const xs_str *msg, const char *ntfy_server, const char *ntfy_token); void enqueue_message(snac *snac, const xs_dict *msg);