snac2

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

commit f5d3859e07e931e9dd230375f36d27a3b72699fc
parent 5d126d0e9ed2763fa6db1d533d33069a74db8b0f
Author: default <nobody@localhost>
Date:   Wed,  8 Feb 2023 14:47:23 +0100

Added the user to the notification.

Diffstat:
Mactivitypub.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/activitypub.c b/activitypub.c @@ -780,10 +780,10 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, xs_str *in_reply_t } -void notify(snac *snac, char *type, char *utype, char *actor, char *msg) +void notify(snac *snac, xs_str *type, xs_str *utype, xs_str *actor, xs_dict *msg) /* notifies the user of relevant events */ { - char *object = NULL; + xs_val *object = NULL; if (strcmp(type, "Create") == 0) { /* only notify of notes specifically for us */ @@ -812,7 +812,10 @@ void notify(snac *snac, char *type, char *utype, char *actor, char *msg) } /* prepare message body */ - xs *body = xs_str_new(NULL); + xs *body = xs_fmt("User : @%s@%s\n", + xs_dict_get(snac->config, "uid"), + xs_dict_get(srv_config, "host") + ); if (strcmp(utype, "(null)") != 0) { xs *s1 = xs_fmt("Type : %s + %s\n", type, utype);