snac2

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

commit 7cd62dd25b92780ef4e1ad42c1d2e9ba69c931e9
parent 2611c816b01d3999ffcf3b59c0d3592908054950
Author: default <nobody@localhost>
Date:   Wed, 22 Jan 2025 05:29:25 +0100

Don't account as such announces by our own relay.

Diffstat:
Mactivitypub.c | 15++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/activitypub.c b/activitypub.c @@ -2274,11 +2274,16 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req) xs *who_o = NULL; if (valid_status(actor_request(snac, who, &who_o))) { - if (timeline_admire(snac, object, actor, 0) == HTTP_STATUS_CREATED) - snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); - else - snac_log(snac, xs_fmt("repeated 'Announce' from %s to %s", - actor, object)); + /* don't account as such announces by our own relay */ + xs *this_relay = xs_fmt("%s/relay", srv_baseurl); + + if (strcmp(actor, this_relay) != 0) { + if (timeline_admire(snac, object, actor, 0) == HTTP_STATUS_CREATED) + snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); + else + snac_log(snac, xs_fmt("repeated 'Announce' from %s to %s", + actor, object)); + } /* distribute the post with the actor as 'proxy' */ list_distribute(snac, actor, a_msg);