diff options
author | Vitaly Takmazov | 2018-10-07 00:33:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-07 00:33:21 +0300 |
commit | b1499230aa4a53b8ee406d17b991100c17615f84 (patch) | |
tree | c96b614b8e6d3731b1499090c7071a53628936a6 /juick-server/src/main/java/com/juick/server/api/activity | |
parent | 2109acda68cce512b7b2dc80f8243651a213374d (diff) |
ActivityPub: handle Delete activity
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/activity/Profile.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index 6a35f3d9..96ed75d1 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -311,6 +311,15 @@ public class Profile { } } } + if (activity instanceof Delete) { + Map<String, Object> tombstone = (Map<String, Object>) activity.getObject(); + if (tombstone.get("type").equals("Tombstone")) { + URI actor = URI.create(activity.getActor()); + URI reply = URI.create((String)tombstone.get("id")); + messagesService.deleteReply(actor, reply); + return new ResponseEntity<>(HttpStatus.OK); + } + } logger.warn("Unknown activity: {}", jsonMapper.writeValueAsString(activity)); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } |