From 31aeb6e69b5e7c329af9a0838caf848fd5300aa9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 10 Oct 2018 16:09:26 +0300 Subject: ActivityPub: fix DeleteUserEvent publication --- juick-server/src/main/java/com/juick/server/SignatureManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'juick-server/src/main/java/com') diff --git a/juick-server/src/main/java/com/juick/server/SignatureManager.java b/juick-server/src/main/java/com/juick/server/SignatureManager.java index 869edbfc..c610ea12 100644 --- a/juick-server/src/main/java/com/juick/server/SignatureManager.java +++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java @@ -6,6 +6,7 @@ import com.juick.server.api.activity.model.Person; import com.juick.service.activities.DeleteUserEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -38,6 +39,8 @@ public class SignatureManager { private KeystoreManager keystoreManager; @Inject private ObjectMapper jsonMapper; + @Inject + private ApplicationEventPublisher applicationEventPublisher; public void post(Person from, Person to, Context data) throws IOException { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(to.getInbox()); @@ -87,7 +90,7 @@ public class SignatureManager { logger.warn("Cannot identify {}", contextUri); if (e.getStatusCode().equals(HttpStatus.GONE)) { logger.warn("Server report {} is gone, deleting", contextUri); - new DeleteUserEvent(this, contextUri.toASCIIString()); + applicationEventPublisher.publishEvent(new DeleteUserEvent(this, contextUri.toASCIIString())); } } return Optional.empty(); -- cgit v1.2.3