From a7d29047bd49ae8afc887abba0317ba7d4aa49b1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 24 Feb 2019 12:21:01 +0300 Subject: Activity object still able to be Map --- src/main/java/com/juick/server/api/activity/Profile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/juick/server/api/activity/Profile.java b/src/main/java/com/juick/server/api/activity/Profile.java index f5d8025c..4e375a54 100644 --- a/src/main/java/com/juick/server/api/activity/Profile.java +++ b/src/main/java/com/juick/server/api/activity/Profile.java @@ -362,7 +362,8 @@ public class Profile { } if (activity instanceof Like || activity instanceof Announce) { String messageUri = activity.getObject() instanceof String ? (String) activity.getObject() - : ((Context) activity.getObject()).getId(); + : activity.getObject() instanceof Context ? ((Context) activity.getObject()).getId() + : (String) ((Map)activity.getObject()).get("id"); applicationEventPublisher.publishEvent(new AnnounceEvent(this, activity.getActor(), messageUri)); return new ResponseEntity<>(CommandResult.fromString("Like/announce request accepted"), HttpStatus.OK); } -- cgit v1.2.3