Resolve object id instead of discarding like or boost.

This commit is contained in:
default 2022-09-26 07:19:45 +02:00
parent d1a2a7438d
commit 5321295005

View file

@ -296,23 +296,21 @@ void process_message(snac *snac, char *msg, char *req)
else else
*/ */
if (strcmp(type, "Like") == 0) { if (strcmp(type, "Like") == 0) {
if (xs_type(object) == XSTYPE_STRING) { if (xs_type(object) == XSTYPE_DICT)
timeline_admire(snac, object, actor, 1); object = xs_dict_get(object, "id");
snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object));
} timeline_admire(snac, object, actor, 1);
else snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object));
snac_debug(snac, 2, xs_fmt("xs_type for 'Like' object not string"));
} }
else else
if (strcmp(type, "Announce") == 0) { if (strcmp(type, "Announce") == 0) {
if (xs_type(object) == XSTYPE_STRING) { if (xs_type(object) == XSTYPE_DICT)
timeline_request(snac, object); object = xs_dict_get(object, "id");
timeline_admire(snac, object, actor, 0); timeline_request(snac, object);
snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
} timeline_admire(snac, object, actor, 0);
else snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
snac_debug(snac, 2, xs_fmt("xs_type for 'Announce' object not string"));
} }
/* /*
else else