diff options
| -rw-r--r-- | activitypub.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 1513be3..732aaac 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1514,6 +1514,22 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) | |||
| 1514 | srv_debug(1, xs_fmt("dropped 'Delete' message from unknown actor '%s'", actor)); | 1514 | srv_debug(1, xs_fmt("dropped 'Delete' message from unknown actor '%s'", actor)); |
| 1515 | return -1; | 1515 | return -1; |
| 1516 | } | 1516 | } |
| 1517 | |||
| 1518 | /* discard crap */ | ||
| 1519 | if (xs_is_null(object)) { | ||
| 1520 | srv_log(xs_fmt("dropped 'Delete' message with invalid object from actor '%s'", actor)); | ||
| 1521 | return -1; | ||
| 1522 | } | ||
| 1523 | |||
| 1524 | /* also discard if the object to be deleted is not here */ | ||
| 1525 | char *obj_id = object; | ||
| 1526 | if (xs_type(obj_id) == XSTYPE_DICT) | ||
| 1527 | obj_id = xs_dict_get(obj_id, "id"); | ||
| 1528 | |||
| 1529 | if (object_here(obj_id)) { | ||
| 1530 | srv_debug(1, xs_fmt("dropped 'Delete' message from unknown object '%s'", obj_id)); | ||
| 1531 | return -1; | ||
| 1532 | } | ||
| 1517 | } | 1533 | } |
| 1518 | 1534 | ||
| 1519 | /* bring the actor */ | 1535 | /* bring the actor */ |