summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-11 20:10:23 +0200
committerdefault <nobody@localhost>2023-06-11 20:10:23 +0200
commitcf2cfca62401da0b5c0604d4d4bcbe8c8356d6f2 (patch)
tree078ff5013a394bb34c81a4256fa7a733b5e7c600
parent1dd88aa6f67beca1ea769f2545417f50531fa4ea (diff)
Also reject Like messages in is_msg_for_me().
-rw-r--r--activitypub.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c
index 402d6a1..b253b22 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -383,12 +383,16 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
{
const char *type = xs_dict_get(c_msg, "type");
- if (strcmp(type, "Announce") == 0) {
+ if (strcmp(type, "Like") == 0 || strcmp(type, "Announce") == 0) {
const char *object = xs_dict_get(c_msg, "object");
if (xs_type(object) == XSTYPE_DICT)
object = xs_dict_get(object, "id");
+ /* bad object id? reject */
+ if (xs_type(object) != XSTYPE_STRING)
+ return 0;
+
/* if it's about one of our posts, accept it */
if (xs_startswith(object, snac->actor))
return 2;