Added support for Accept objects that only provide an object id.

This allows following Guppe groups.
This commit is contained in:
default 2023-07-24 20:37:31 +02:00
parent 1882c25a17
commit dc5c1ce0ac

View file

@ -1512,7 +1512,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
} }
else else
if (strcmp(type, "Accept") == 0) { /** **/ if (strcmp(type, "Accept") == 0) { /** **/
if (strcmp(utype, "Follow") == 0) { /** **/ if (strcmp(utype, "Follow") == 0 || strcmp(utype, "(null)") == 0) { /** **/
if (following_check(snac, actor)) { if (following_check(snac, actor)) {
following_add(snac, actor, msg); following_add(snac, actor, msg);
snac_log(snac, xs_fmt("confirmed follow from %s", actor)); snac_log(snac, xs_fmt("confirmed follow from %s", actor));
@ -1520,9 +1520,11 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
else else
snac_log(snac, xs_fmt("spurious follow accept from %s", actor)); snac_log(snac, xs_fmt("spurious follow accept from %s", actor));
} }
else else {
srv_archive_error("accept", "ignored Accept", req, msg);
snac_debug(snac, 1, xs_fmt("ignored 'Accept' for object type '%s'", utype)); snac_debug(snac, 1, xs_fmt("ignored 'Accept' for object type '%s'", utype));
} }
}
else else
if (strcmp(type, "Like") == 0) { /** **/ if (strcmp(type, "Like") == 0) { /** **/
if (xs_type(object) == XSTYPE_DICT) if (xs_type(object) == XSTYPE_DICT)