summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-26 07:19:45 +0200
committerdefault <nobody@localhost>2022-09-26 07:19:45 +0200
commit5321295005c898f401bf6485c97954845ad96b4c (patch)
tree9867cc6e28a6d8c037105c9d24d6f2ca4bee294a /activitypub.c
parentd1a2a7438dddc898b794a7a9b3b0961afc1a36e4 (diff)
Resolve object id instead of discarding like or boost.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/activitypub.c b/activitypub.c
index 4b2947e..ca24103 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -296,23 +296,21 @@ void process_message(snac *snac, char *msg, char *req)
else
*/
if (strcmp(type, "Like") == 0) {
- if (xs_type(object) == XSTYPE_STRING) {
- timeline_admire(snac, object, actor, 1);
- snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object));
- }
- else
- snac_debug(snac, 2, xs_fmt("xs_type for 'Like' object not string"));
+ 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));
}
else
if (strcmp(type, "Announce") == 0) {
- if (xs_type(object) == XSTYPE_STRING) {
- timeline_request(snac, object);
+ if (xs_type(object) == XSTYPE_DICT)
+ object = xs_dict_get(object, "id");
- timeline_admire(snac, object, actor, 0);
- snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
- }
- else
- snac_debug(snac, 2, xs_fmt("xs_type for 'Announce' object not string"));
+ timeline_request(snac, object);
+
+ timeline_admire(snac, object, actor, 0);
+ snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
}
/*
else