diff options
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/Profile.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java index e6a4e789..8a879f3b 100644 --- a/src/main/java/com/juick/www/api/activity/Profile.java +++ b/src/main/java/com/juick/www/api/activity/Profile.java @@ -383,20 +383,13 @@ public class Profile { } } if (activity instanceof Delete) { - // Delete gone user - // TODO: check if it is really deleted and remove copy-paste - if (activity.getActor().equals(activity.getObject().getId())) { - return new ResponseEntity<>(CommandResult.fromString("Delete request accepted"), - HttpStatus.ACCEPTED); - } - - if (activity.getObject() instanceof Tombstone) { - Tombstone tombstone = (Tombstone) activity.getObject(); + URI objectId = URI.create(activity.getObject().getId()); + if (messagesService.replyExists(objectId)) { URI actor = URI.create(activity.getActor()); - URI reply = URI.create((String) tombstone.getId()); - messagesService.deleteReply(actor, reply); - return new ResponseEntity<>(CommandResult.fromString("Delete request accepted"), HttpStatus.OK); + messagesService.deleteReply(actor, objectId); } + // accept all authenticated Delete activities + return new ResponseEntity<>(CommandResult.fromString("Delete request accepted"), HttpStatus.OK); } if (activity instanceof Like || activity instanceof Announce) { String messageUri = activity.getObject().getId(); |