aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/PM.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-09-24 11:54:21 +0300
committerGravatar Vitaly Takmazov2019-09-24 11:54:21 +0300
commit2f2e9aab6194037259625200091949d8648e3409 (patch)
tree4669e3bf5389bf68581094ab01dee4155a91e24f /src/main/java/com/juick/server/api/PM.java
parent289afd5a0b510e4501cf421dd9a05bb53bc424c3 (diff)
Use single event model for all application events
Diffstat (limited to 'src/main/java/com/juick/server/api/PM.java')
-rw-r--r--src/main/java/com/juick/server/api/PM.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/api/PM.java b/src/main/java/com/juick/server/api/PM.java
index b65841c0..4a408dce 100644
--- a/src/main/java/com/juick/server/api/PM.java
+++ b/src/main/java/com/juick/server/api/PM.java
@@ -28,7 +28,7 @@ import com.juick.server.util.WebUtils;
import com.juick.server.www.WebApp;
import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
-import com.juick.service.component.MessageEvent;
+import com.juick.service.component.SystemEvent;
import com.juick.service.security.annotation.Visitor;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.MediaType;
@@ -97,7 +97,9 @@ public class PM {
jmsg.setText(body);
jmsg.setTo(userTo);
jmsg.getUser().setAvatar(webApp.getAvatarUrl(jmsg.getUser()));
- applicationEventPublisher.publishEvent(new MessageEvent(this, jmsg, Collections.singletonList(jmsg.getTo())));
+ applicationEventPublisher.publishEvent(
+ new SystemEvent(this,
+ SystemActivity.message(jmsg.getUser(), jmsg, Collections.singletonList(jmsg.getTo()))));
return jmsg;
}