aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/ActivityPubManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/ActivityPubManager.java')
-rw-r--r--src/main/java/com/juick/ActivityPubManager.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java
index cb4d0b54..1e97a54e 100644
--- a/src/main/java/com/juick/ActivityPubManager.java
+++ b/src/main/java/com/juick/ActivityPubManager.java
@@ -217,6 +217,29 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
}
}
}
+
+ @Override
+ public void processUpdateUserEvent(UpdateUserEvent event) {
+ User user = event.getUser();
+ String userUri = personUri(user);
+ Person me = (Person) signatureManager.getContext(URI.create(userUri)).get();
+ socialService.getFollowers(user).forEach(acct -> {
+ try {
+ Person follower = (Person) signatureManager.getContext(URI.create(acct)).orElseThrow();
+ Update update = new Update();
+ update.setId(userUri + "#update");
+ update.setActor(me.getId());
+ update.setObject(new Context(userUri));
+ logger.info("Update to follower {}", follower.getId());
+ signatureManager.post(me, follower, update);
+ } catch (NoSuchElementException e) {
+ logger.warn("Person not verified: {}", acct);
+ } catch (IOException | NoSuchAlgorithmException e) {
+ logger.warn("activitypub exception", e);
+ }
+ });
+ }
+
private void processMessage(Message msg) {
if (MessageUtils.isPM(msg) || msg.isService()) {
return;