summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c
index a7b6c0b..5d79593 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -677,17 +677,20 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
677 677
678 if (xs_match(type, "Like|Announce|EmojiReact")) { 678 if (xs_match(type, "Like|Announce|EmojiReact")) {
679 const char *object = xs_dict_get(c_msg, "object"); 679 const char *object = xs_dict_get(c_msg, "object");
680 xs *obj = NULL;
680 681
681 if (xs_is_dict(object)) 682 if (xs_is_dict(object)) {
683 obj = xs_dup(object);
682 object = xs_dict_get(object, "id"); 684 object = xs_dict_get(object, "id");
685 }
683 686
684 /* bad object id? reject */ 687 /* bad object id? reject */
685 if (!xs_is_string(object)) 688 if (!xs_is_string(object))
686 return 0; 689 return 0;
687 690
688 xs *obj = NULL; 691 /* try to get the object */
689 if (!valid_status(object_get(object, &obj))) 692 if (!xs_is_dict(obj))
690 return 0; 693 object_get(object, &obj);
691 694
692 /* if it's about one of our posts, accept it */ 695 /* if it's about one of our posts, accept it */
693 if (xs_startswith(object, snac->actor)) 696 if (xs_startswith(object, snac->actor))