aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-03-24 18:07:56 +0300
committerGravatar Vitaly Takmazov2021-03-24 18:07:56 +0300
commitb236ca54772d9dcc76e8694012dab99044601b5d (patch)
tree1024c19d4568993c5783c0c7df1974439f27e78b /src/main/java/com/juick
parent06cbddff34ce33cfff4fd6a265c5752cc95a6e53 (diff)
ActivityPub: handle unverified deletions
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/ActivityPubManager.java14
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);
}