aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-06 23:02:14 +0300
committerGravatar Vitaly Takmazov2018-10-06 23:02:14 +0300
commit0b065e1e0547885294d03df54d178587d801a15a (patch)
treecde84364a49e507be61a785e0596489385a511ff /juick-server/src/main/java/com/juick/server
parent4b7702d846c281459433cf51dab5669fb3466b12 (diff)
store external reply uri
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/ActivityPubManager.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java1
2 files changed, 6 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java
index 3d296d8f..4adfafea 100644
--- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java
+++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java
@@ -183,7 +183,11 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
note.setUrl(PlainTextFormatter.formatUrl(msg));
note.setAttributedTo(personUri(msg.getUser()));
if (MessageUtils.isReply(msg)) {
- note.setInReplyTo(messageUri(msg.getMid(), msg.getReplyto()));
+ if (msg.getReplyUri().toASCIIString().length() > 0) {
+ note.setInReplyTo(msg.getReplyUri().toASCIIString());
+ } else {
+ note.setInReplyTo(messageUri(msg.getMid(), msg.getReplyto()));
+ }
}
if (MessageUtils.isPM(msg)) {
note.setTo(Collections.singletonList(personUri(msg.getTo())));
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 b016afc9..261552d7 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
@@ -295,6 +295,7 @@ public class Profile {
CommandResult result = commandsManager.processCommand(user, String.format("#%s %s", postId, note.get("content")), URI.create(attachment));
logger.info(jsonMapper.writeValueAsString(result));
if (result.getNewMessage().isPresent()) {
+ messagesService.updateReplyUri(result.getNewMessage().get(), URI.create((String)note.get("id")));
return new ResponseEntity<>(HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);