summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-02-21 09:22:32 +0100
committerdefault <nobody@localhost>2024-02-21 09:22:32 +0100
commite9553379e9922119468bc5ad1f26629c95f57e8d (patch)
tree2c3e10e3c1075dc7fa75719f6a955b46777b258e /activitypub.c
parentae6aafeb881c075a49eddd834bcfc21e9fc63b18 (diff)
Log (and not notify) repeated likes and announces.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/activitypub.c b/activitypub.c
index e389915..d8f748e 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1955,9 +1955,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
if (xs_type(object) == XSTYPE_DICT)
object = xs_dict_get(object, "id");
- timeline_admire(snac, object, actor, 1);
- snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object));
- do_notify = 1;
+ if (timeline_admire(snac, object, actor, 1) == 201) {
+ snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object));
+ do_notify = 1;
+ }
+ else
+ snac_log(snac, xs_fmt("repeated 'Like' from %s to %s", actor, object));
}
else
if (strcmp(type, "Announce") == 0) { /** **/
@@ -1983,9 +1986,13 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
xs *who_o = NULL;
if (valid_status(actor_request(snac, who, &who_o))) {
- timeline_admire(snac, object, actor, 0);
- snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
- do_notify = 1;
+ if (timeline_admire(snac, object, actor, 0) == 201) {
+ snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
+ do_notify = 1;
+ }
+ else
+ snac_log(snac, xs_fmt("repeated 'Announce' from %s to %s",
+ actor, object));
}
else
snac_debug(snac, 1, xs_fmt("dropped 'Announce' on actor request error %s", who));