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.java23
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Context.java1
2 files changed, 21 insertions, 3 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 96ed75d1..669a28df 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,5 @@
package com.juick.server.api.activity;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.juick.User;
import com.juick.model.CommandResult;
@@ -8,7 +7,15 @@ import com.juick.server.ActivityPubManager;
import com.juick.server.CommandsManager;
import com.juick.server.KeystoreManager;
import com.juick.server.SignatureManager;
-import com.juick.server.api.activity.model.*;
+import com.juick.server.api.activity.model.Activity;
+import com.juick.server.api.activity.model.Context;
+import com.juick.server.api.activity.model.Image;
+import com.juick.server.api.activity.model.Key;
+import com.juick.server.api.activity.model.Note;
+import com.juick.server.api.activity.model.OrderedCollection;
+import com.juick.server.api.activity.model.OrderedCollectionPage;
+import com.juick.server.api.activity.model.Person;
+import com.juick.server.api.activity.model.activities.Announce;
import com.juick.server.api.activity.model.activities.Create;
import com.juick.server.api.activity.model.activities.Delete;
import com.juick.server.api.activity.model.activities.Follow;
@@ -29,7 +36,13 @@ import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
@@ -320,6 +333,10 @@ public class Profile {
return new ResponseEntity<>(HttpStatus.OK);
}
}
+ if (activity instanceof Announce) {
+ logger.info("Announce: {}", jsonMapper.writeValueAsString(activity));
+ return new ResponseEntity<>(HttpStatus.OK);
+ }
logger.warn("Unknown activity: {}", jsonMapper.writeValueAsString(activity));
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java
index 64779b51..0c47ef73 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Context.java
@@ -20,6 +20,7 @@ import java.util.List;
@JsonSubTypes.Type(value = Undo.class, name = "Undo"),
@JsonSubTypes.Type(value = Like.class, name = "Like"),
@JsonSubTypes.Type(value = Block.class, name = "Block"),
+ @JsonSubTypes.Type(value = Announce.class, name = "Announce"),
@JsonSubTypes.Type(value = Activity.class, name = "Activity"),
@JsonSubTypes.Type(value = Image.class, name = "Image"),
@JsonSubTypes.Type(value = Key.class, name = "Key"),