aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java14
1 files changed, 14 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 357ca29c8..393b001b2 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
@@ -1,6 +1,7 @@
package com.juick.server.api.activity;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.juick.Message;
import com.juick.User;
import com.juick.model.CommandResult;
import com.juick.server.ActivityPubManager;
@@ -321,6 +322,19 @@ public class Profile {
} else {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
+ } else {
+ Message reply = messagesService.getReplyByUri(inReplyTo);
+ if (reply != null) {
+ User user = new User();
+ user.setUri(URI.create(activity.getActor()));
+ String attachment = StringUtils.EMPTY;
+ if (note.get("attachment") != null && ((List) note.get("attachment")).size() > 0) {
+ Map<String, Object> attachmentObj = (Map<String, Object>) ((List<Object>) note.get("attachment")).get(0);
+ attachment = (String) attachmentObj.get("url");
+ }
+ CommandResult result = commandsManager.processCommand(user, String.format("#%d/%d %s", reply.getMid(), reply.getRid(), note.get("content")), URI.create(attachment));
+ logger.info(jsonMapper.writeValueAsString(result));
+ }
}
}
}