aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-02-23 21:32:34 +0300
committerGravatar Vitaly Takmazov2019-02-23 21:32:34 +0300
commit0682e5c1a3f71c3bbb23ac646d2a4e54a472ac06 (patch)
tree39a54a3da9652c2ed6526c7ec75262fbf1515afc /src/main/java/com
parentb0898ebd93a6aabdb58be182c3f8e9ac4f0b44b7 (diff)
Announce object may be Context
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/server/api/activity/Profile.java4
1 files changed, 3 insertions, 1 deletions
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 c26941ef..f5d8025c 100644
--- a/src/main/java/com/juick/server/api/activity/Profile.java
+++ b/src/main/java/com/juick/server/api/activity/Profile.java
@@ -361,7 +361,9 @@ public class Profile {
}
}
if (activity instanceof Like || activity instanceof Announce) {
- applicationEventPublisher.publishEvent(new AnnounceEvent(this, activity.getActor(), (String)activity.getObject()));
+ String messageUri = activity.getObject() instanceof String ? (String) activity.getObject()
+ : ((Context) activity.getObject()).getId();
+ applicationEventPublisher.publishEvent(new AnnounceEvent(this, activity.getActor(), messageUri));
return new ResponseEntity<>(CommandResult.fromString("Like/announce request accepted"), HttpStatus.OK);
}
logger.warn("Unknown activity: {}", jsonMapper.writeValueAsString(activity));