aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-24 09:35:50 +0300
committerGravatar Vitaly Takmazov2022-12-24 09:35:50 +0300
commite50ca63d32f765a75a9248caf92cf98233ce097c (patch)
tree7ddb52fbdd9d75c42221bd9e9fae6cad9f0d10bd /src/main
parentb6a76493f1711ad42cc8543bc73ae70b3d75868e (diff)
ActivityPub Update compatibility improvements
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/ActivityPubManager.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java
index 1fff41fc..63417626 100644
--- a/src/main/java/com/juick/ActivityPubManager.java
+++ b/src/main/java/com/juick/ActivityPubManager.java
@@ -51,6 +51,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.net.URI;
import java.security.NoSuchAlgorithmException;
+import java.time.Instant;
import java.util.*;
import java.util.stream.Collectors;
@@ -127,6 +128,8 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
signatureManager.post(me, follower, delete);
} catch (IOException | NoSuchAlgorithmException e) {
logger.warn("activitypub exception", e);
+ } catch (NoSuchElementException ex) {
+ logger.warn("Can not find {}", acct);
}
});
}
@@ -172,9 +175,10 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
update.setId(note.getId() + "#update");
update.setActor(me.getId());
update.setObject(note);
+ update.setPublished(Instant.now());
logger.info("Update to follower {}", follower.getId());
signatureManager.post(me, follower, update);
- } catch (IOException | NoSuchAlgorithmException e) {
+ } catch (Exception e) {
logger.warn("{} exception", acct, e);
}
});
@@ -201,10 +205,11 @@ public class ActivityPubManager implements ActivityListener, NotificationListene
Update update = new Update();
update.setId(userUri + "#update");
update.setActor(me.getId());
- update.setObject(new Context(userUri));
+ update.setObject(me);
+ update.setPublished(Instant.now());
logger.info("Update to follower {}", follower.getId());
signatureManager.post(me, follower, update);
- } catch (IOException | NoSuchAlgorithmException e) {
+ } catch (Exception e) {
logger.warn("activitypub exception", e);
}
});