aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-19 21:11:53 +0300
committerGravatar Vitaly Takmazov2023-01-19 21:11:53 +0300
commit1e82cb7125e4aa81dcbafa4746af1f0f9651b8c1 (patch)
tree11a23732a035e593226a1ac973c7a236b1c92947 /src
parent1391dca75899c9260e6248b4d4bb2446e9d926ba (diff)
Cleanup logging
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/ActivityPubManager.java10
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 {