mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Added some more logging.
This commit is contained in:
parent
be9cf2f555
commit
79df266bfe
@ -1988,8 +1988,15 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
|||||||
if (xs_match(utype, "Note|Article")) { /** **/
|
if (xs_match(utype, "Note|Article")) { /** **/
|
||||||
char *id = xs_dict_get(object, "id");
|
char *id = xs_dict_get(object, "id");
|
||||||
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
||||||
|
char *atto = get_atto(object);
|
||||||
xs *wrk = NULL;
|
xs *wrk = NULL;
|
||||||
|
|
||||||
|
if (xs_is_null(id))
|
||||||
|
snac_log(snac, xs_fmt("malformed message: no 'id' field"));
|
||||||
|
else
|
||||||
|
if (xs_is_null(atto))
|
||||||
|
snac_log(snac, xs_fmt("malformed message: no 'attributedTo' field"));
|
||||||
|
else
|
||||||
if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) {
|
if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) {
|
||||||
snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to));
|
snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to));
|
||||||
}
|
}
|
||||||
@ -1999,6 +2006,9 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(actor, atto) != 0)
|
||||||
|
snac_log(snac, xs_fmt("SUSPICIOUS: actor != atto (%s != %s)", actor, atto));
|
||||||
|
|
||||||
timeline_request(snac, &in_reply_to, &wrk, 0);
|
timeline_request(snac, &in_reply_to, &wrk, 0);
|
||||||
|
|
||||||
if (timeline_add(snac, id, object)) {
|
if (timeline_add(snac, id, object)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user