diff options
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java | 2 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java index 19275b366..2597ddbc2 100644 --- a/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java +++ b/juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java @@ -88,6 +88,7 @@ public class JuickProtocol { String body = input.substring(TagUtils.toString(tags).length()); int mid = messagesService.createMessage(user.getUid(), body, null, tags); subscriptionService.subscribeMessage(mid, user.getUid()); + listener.messagePosted(messagesService.getMessage(mid)); return new ProtocolReply("New message posted.\n#" + mid + " " + baseUri + mid); } @@ -344,6 +345,7 @@ public class JuickProtocol { return new ProtocolReply("Tags are updated"); } else { int newrid = messagesService.createReply(mid, rid, user.getUid(), txt, null); + listener.messagePosted(messagesService.getReply(mid, newrid)); return new ProtocolReply("Reply posted.\n#" + mid + "/" + newrid + " " + baseUri + mid + "#" + newrid); } diff --git a/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java b/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java index 719520c71..11231e04d 100644 --- a/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java +++ b/juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java @@ -1,5 +1,6 @@ package com.juick.server.protocol; +import com.juick.Message; import com.juick.User; /** @@ -8,4 +9,5 @@ import com.juick.User; public interface ProtocolListener { void privateMessage(User from, User to, String body); void userSubscribed(User from, User to); + void messagePosted(Message msg); } |