aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java
index 8a879f3b..495ca8f9 100644
--- a/src/main/java/com/juick/www/api/activity/Profile.java
+++ b/src/main/java/com/juick/www/api/activity/Profile.java
@@ -34,6 +34,7 @@ import com.juick.www.api.activity.model.activities.Flag;
import com.juick.www.api.activity.model.activities.Follow;
import com.juick.www.api.activity.model.activities.Like;
import com.juick.www.api.activity.model.activities.Undo;
+import com.juick.www.api.activity.model.activities.Update;
import com.juick.www.api.activity.model.objects.Actor;
import com.juick.www.api.activity.model.objects.Application;
import com.juick.www.api.activity.model.objects.Image;
@@ -302,13 +303,13 @@ public class Profile {
if (activity instanceof Undo) {
Context object = activity.getObject();
if (object instanceof Follow) {
- applicationEventPublisher
- .publishEvent(new UndoFollowEvent(this, activity.getActor(), ((Activity)object).getObject().getId()));
+ applicationEventPublisher.publishEvent(
+ new UndoFollowEvent(this, activity.getActor(), ((Activity) object).getObject().getId()));
return new ResponseEntity<>(CommandResult.fromString("Undo follow request accepted"),
HttpStatus.OK);
} else if (object instanceof Like || object instanceof Announce) {
- applicationEventPublisher
- .publishEvent(new UndoAnnounceEvent(this, activity.getActor(), ((Activity)object).getObject().getId()));
+ applicationEventPublisher.publishEvent(
+ new UndoAnnounceEvent(this, activity.getActor(), ((Activity) object).getObject().getId()));
return new ResponseEntity<>(CommandResult.fromString("Undo like/announce request accepted"),
HttpStatus.OK);
}
@@ -401,6 +402,13 @@ public class Profile {
logger.info("{} flag some objects: {}", actor, activity.getObject());
return new ResponseEntity<>(CommandResult.fromString("Report accepted"), HttpStatus.ACCEPTED);
}
+ if (activity instanceof Update) {
+ if (activity.getObject() instanceof Person
+ && activity.getActor().equals(activity.getObject().getId())) {
+ logger.info("{} update they profile");
+ return new ResponseEntity<>(CommandResult.fromString("Update accepted"), HttpStatus.ACCEPTED);
+ }
+ }
logger.warn("Unknown activity: {}", jsonMapper.writeValueAsString(activity));
return new ResponseEntity<>(CommandResult.fromString("Unknown activity"), HttpStatus.NOT_IMPLEMENTED);
}