summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-05-05 08:23:12 +0200
committerGravatar default2024-05-05 08:23:12 +0200
commit79df266bfe68d9ab74378780aaf99546300a836d (patch)
tree1e80328a4fc3f0a7531c88c2f6a0343a5492efaa
parentEnqueue an object request for closed polls. (diff)
downloadpenes-snac2-79df266bfe68d9ab74378780aaf99546300a836d.tar.gz
penes-snac2-79df266bfe68d9ab74378780aaf99546300a836d.tar.xz
penes-snac2-79df266bfe68d9ab74378780aaf99546300a836d.zip
Added some more logging.
-rw-r--r--activitypub.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index bb919ed..301fd4c 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1988,8 +1988,15 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1988 if (xs_match(utype, "Note|Article")) { /** **/ 1988 if (xs_match(utype, "Note|Article")) { /** **/
1989 char *id = xs_dict_get(object, "id"); 1989 char *id = xs_dict_get(object, "id");
1990 char *in_reply_to = xs_dict_get(object, "inReplyTo"); 1990 char *in_reply_to = xs_dict_get(object, "inReplyTo");
1991 char *atto = get_atto(object);
1991 xs *wrk = NULL; 1992 xs *wrk = NULL;
1992 1993
1994 if (xs_is_null(id))
1995 snac_log(snac, xs_fmt("malformed message: no 'id' field"));
1996 else
1997 if (xs_is_null(atto))
1998 snac_log(snac, xs_fmt("malformed message: no 'attributedTo' field"));
1999 else
1993 if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) { 2000 if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) {
1994 snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to)); 2001 snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to));
1995 } 2002 }
@@ -1999,6 +2006,9 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1999 return 1; 2006 return 1;
2000 } 2007 }
2001 2008
2009 if (strcmp(actor, atto) != 0)
2010 snac_log(snac, xs_fmt("SUSPICIOUS: actor != atto (%s != %s)", actor, atto));
2011
2002 timeline_request(snac, &in_reply_to, &wrk, 0); 2012 timeline_request(snac, &in_reply_to, &wrk, 0);
2003 2013
2004 if (timeline_add(snac, id, object)) { 2014 if (timeline_add(snac, id, object)) {