aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/server/protocol/JuickProtocol.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/protocol/ProtocolListener.java2
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 19275b36..2597ddbc 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 719520c7..11231e04 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);
}