diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/juick/ActivityPubManager.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index 61431c71..ad887819 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -138,15 +138,17 @@ public class ActivityPubManager implements ActivityListener, NotificationListene Note note = makeNote(msg); Person me = (Person) signatureManager.getContext(URI.create(userUri)).get(); socialService.getFollowers(user).forEach(acct -> { - Person follower = (Person) signatureManager.getContext(URI.create(acct)).get(); - Delete delete = new Delete(); - delete.setId(note.getId()); - delete.setActor(me.getId()); - delete.setPublished(note.getPublished()); - delete.setObject(note); try { + Person follower = (Person) signatureManager.getContext(URI.create(acct)).orElseThrow(); + Delete delete = new Delete(); + delete.setId(note.getId()); + delete.setActor(me.getId()); + delete.setPublished(note.getPublished()); + delete.setObject(note); logger.info("Deletion to follower {}", follower.getId()); signatureManager.post(me, follower, delete); + } catch (NoSuchElementException e) { + logger.warn("Unverified actor: {}", userUri); } catch (IOException | NoSuchAlgorithmException e) { logger.warn("activitypub exception", e); } |