snac2

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

commit 1001744ddb48ed3cb49d1d6d1a607852d6d385de
parent a09ea11f551969e2239cbf65293205da9cae37fe
Author: default <nobody@localhost>
Date:   Wed, 31 Jul 2024 06:22:13 +0200

Notify objects include the original message.

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

diff --git a/activitypub.c b/activitypub.c @@ -949,7 +949,7 @@ void notify(snac *snac, const char *type, const char *utype, const char *actor, if (strcmp(utype, "Follow") == 0) objid = actor; - notify_add(snac, type, utype, actor, objid != NULL ? objid : id); + notify_add(snac, type, utype, actor, objid != NULL ? objid : id, msg); } /** messages **/ @@ -2180,6 +2180,8 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req) snac_log(snac, xs_fmt("'Move': unfollowing %s", old_account)); } + + do_notify = 1; } else snac_log(snac, xs_fmt("'Move' error: old actor %s not found in %s 'alsoKnownAs'", diff --git a/data.c b/data.c @@ -2517,7 +2517,7 @@ xs_str *notify_check_time(snac *snac, int reset) void notify_add(snac *snac, const char *type, const char *utype, - const char *actor, const char *objid) + const char *actor, const char *objid, const xs_dict *msg) /* adds a new notification */ { xs *ntid = tid(0); @@ -2537,6 +2537,7 @@ void notify_add(snac *snac, const char *type, const char *utype, noti = xs_dict_append(noti, "utype", utype); noti = xs_dict_append(noti, "actor", actor); noti = xs_dict_append(noti, "date", date); + noti = xs_dict_append(noti, "msg", msg); if (!xs_is_null(objid)) noti = xs_dict_append(noti, "objid", objid); diff --git a/snac.h b/snac.h @@ -207,7 +207,7 @@ void lastlog_write(snac *snac, const char *source); xs_str *notify_check_time(snac *snac, int reset); void notify_add(snac *snac, const char *type, const char *utype, - const char *actor, const char *objid); + const char *actor, const char *objid, const xs_dict *msg); xs_dict *notify_get(snac *snac, const char *id); int notify_new_num(snac *snac); xs_list *notify_list(snac *snac, int skip, int show);