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.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/com/juick/api/PM.java b/src/main/java/com/juick/api/PM.java
index 01a5669a..3ca9eada 100644
--- a/src/main/java/com/juick/api/PM.java
+++ b/src/main/java/com/juick/api/PM.java
@@ -29,7 +29,9 @@ public class PM {
this.sql = sql;
}
- public void doGetPM(HttpServletRequest request, HttpServletResponse response, int vuid) throws ServletException, IOException {
+ public void doGetPM(HttpServletRequest request,
+ HttpServletResponse response, int vuid)
+ throws ServletException, IOException {
String uname = request.getParameter("uname");
int uid = 0;
if (uname != null && uname.matches("^[a-zA-Z0-9\\-]{2,16}$")) {
@@ -50,7 +52,9 @@ public class PM {
}
}
- public void doPostPM(HttpServletRequest request, HttpServletResponse response, Stream xmpp, int vuid) throws ServletException, IOException {
+ public void doPostPM(HttpServletRequest request,
+ HttpServletResponse response, Stream xmpp, int vuid)
+ throws ServletException, IOException {
String uname = request.getParameter("uname");
int uid = 0;
if (UserQueries.checkUserNameValid(uname)) {
@@ -73,8 +77,8 @@ public class PM {
msg.from = new JID("juick", "juick.com", null);
msg.to = new JID(Integer.toString(uid), "push.juick.com", null);
JuickMessage jmsg = new JuickMessage();
- jmsg.User = UserQueries.getUserByUID(sql, vuid);
- jmsg.Text = body;
+ jmsg.setUser(UserQueries.getUserByUID(sql, vuid));
+ jmsg.setText(body);
msg.childs.add(jmsg);
xmpp.send(msg);
@@ -89,11 +93,11 @@ public class PM {
mm.to = new JID(jid);
mm.type = Message.Type.chat;
if (PMQueries.havePMinRoster(sql, vuid, jid)) {
- mm.from = new JID(jmsg.User.UName, "juick.com", "Juick");
+ mm.from = new JID(jmsg.getUser().getUName(), "juick.com", "Juick");
mm.body = body;
} else {
mm.from = new JID("juick", "juick.com", "Juick");
- mm.body = "Private message from @" + jmsg.User.UName + ":\n" + body;
+ mm.body = "Private message from @" + jmsg.getUser().getUName() + ":\n" + body;
}
xmpp.send(mm);
}