diff options
author | Vitaly Takmazov | 2023-01-19 21:11:53 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-19 21:11:53 +0300 |
commit | 1e82cb7125e4aa81dcbafa4746af1f0f9651b8c1 (patch) | |
tree | 11a23732a035e593226a1ac973c7a236b1c92947 /src/main/java/com | |
parent | 1391dca75899c9260e6248b4d4bb2446e9d926ba (diff) |
Cleanup logging
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/juick/ActivityPubManager.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index 922ab002..5f42028f 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -203,12 +203,11 @@ public class ActivityPubManager implements ActivityListener, NotificationListene socialService.getFollowers(user).forEach(acct -> { var context = activityPubService.get(URI.create(acct)); context.ifPresentOrElse((follower) -> { - if (follower instanceof Actor) { - var to = (Actor) follower; + if (follower instanceof Actor to) { try { activityPubService.post(from, to, activity); } catch (Exception e) { - logger.warn("Delivery to {} failed: {}", to, e.getMessage()); + logger.warn("Delivery to {} failed: {}", to.getId(), e.getMessage()); } } else { try { @@ -258,8 +257,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene if (!acct.equals(profileUriBuilder.followersUri(user))) { var context = activityPubService.get(URI.create(acct)); context.ifPresentOrElse((follower) -> { - if (follower instanceof Actor) { - var to = (Actor) follower; + if (follower instanceof Actor to) { Create create = new Create(); create.setId(note.getId()); create.setActor(me.getId()); @@ -268,7 +266,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene try { activityPubService.post(me, to, create); } catch (InterruptedException | IOException | NoSuchAlgorithmException e) { - logger.warn("Delivery to {} failed: {}", to, e.getMessage()); + logger.warn("Delivery to {} failed: {}", to.getId(), e.getMessage()); } } else { try { |