aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/api/PM.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/api/PM.java')
-rw-r--r--src/main/java/com/juick/api/PM.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/juick/api/PM.java b/src/main/java/com/juick/api/PM.java
index 2722526d..ffcd155a 100644
--- a/src/main/java/com/juick/api/PM.java
+++ b/src/main/java/com/juick/api/PM.java
@@ -1,5 +1,6 @@
package com.juick.api;
+import com.juick.json.MessageSerializer;
import com.juick.server.PMQueries;
import com.juick.server.UserQueries;
import com.juick.xmpp.JID;
@@ -20,6 +21,8 @@ import javax.servlet.http.HttpServletResponse;
public class PM {
Connection sql;
+
+ MessageSerializer messageSerializer = new MessageSerializer();
public PM(Connection sql) {
this.sql = sql;
@@ -39,7 +42,7 @@ public class PM {
ArrayList<com.juick.Message> msgs = PMQueries.getPMMessages(sql, vuid, uid);
if (msgs != null && !msgs.isEmpty()) {
- String json = com.juick.json.Messages.arrayToString(msgs);
+ String json = messageSerializer.serializeList(msgs);
Main.replyJSON(request, response, json);
} else {
response.sendError(404);
@@ -77,7 +80,7 @@ public class PM {
msg.to.Host = "ws.juick.com";
xmpp.send(msg);
- Main.replyJSON(request, response, com.juick.json.Message.toJSON(jmsg).toString());
+ Main.replyJSON(request, response, messageSerializer.serialize(jmsg).toString());
String jid = UserQueries.getJIDbyUID(sql, uid);
if (jid != null) {