aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-15 15:54:04 +0300
committerGravatar Vitaly Takmazov2016-01-15 15:54:04 +0300
commit30068e18a3d8ae37b509f5cd766515735a818692 (patch)
treec2028e65a088ff07393387cffc0b6ce7d2ddf9cb /src/main/java/com/juick/api/Messages.java
parentabf2c56ab5bc2363a4f33f6f72b90396a9fd3df9 (diff)
update core
Diffstat (limited to 'src/main/java/com/juick/api/Messages.java')
-rw-r--r--src/main/java/com/juick/api/Messages.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main/java/com/juick/api/Messages.java b/src/main/java/com/juick/api/Messages.java
index fb9be051..e242d05b 100644
--- a/src/main/java/com/juick/api/Messages.java
+++ b/src/main/java/com/juick/api/Messages.java
@@ -53,7 +53,9 @@ public class Messages {
this.sql = sql;
}
- public void doGetHome(HttpServletRequest request, HttpServletResponse response, int vuid) throws ServletException, IOException {
+ public void doGetHome(HttpServletRequest request,
+ HttpServletResponse response, int vuid)
+ throws ServletException, IOException {
int before_mid = Utils.parseInt(request.getParameter("before_mid"), 0);
List<Integer> mids = MessagesQueries.getMyFeed(sql, vuid, before_mid);
@@ -70,7 +72,8 @@ public class Messages {
}
}
- public void doGet(HttpServletRequest request, HttpServletResponse response, int vuid)
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response, int vuid)
throws ServletException, IOException {
User user = UserQueries.getUserByName(sql, request.getParameter("uname"));
int before_mid = Utils.parseInt(request.getParameter("before_mid"), 0);
@@ -81,7 +84,9 @@ public class Messages {
}
- public void doGetRecommended(HttpServletRequest request, HttpServletResponse response, int vuid) throws ServletException, IOException {
+ public void doGetRecommended(HttpServletRequest request,
+ HttpServletResponse response, int vuid)
+ throws ServletException, IOException {
int before_mid = Utils.parseInt(request.getParameter("before_mid"), 0);
List<Integer> mids = MessagesQueries.getUserRecommendations(sql, vuid, before_mid);
@@ -98,17 +103,21 @@ public class Messages {
}
}
- public void doSetPrivacy(HttpServletRequest request, HttpServletResponse response, Stream xmpp, int vuid) throws ServletException, IOException {
+ public void doSetPrivacy(HttpServletRequest request,
+ HttpServletResponse response, Stream xmpp, int vuid)
+ throws ServletException, IOException {
int mid = Utils.parseInt(request.getParameter("mid"), 0);
com.juick.User user = MessagesQueries.getMessageAuthor(sql, mid);
- if (user != null && user.UID == vuid && MessagesQueries.setMessagePrivacy(sql, mid)) {
+ if (user != null && user.getUID() == vuid && MessagesQueries.setMessagePrivacy(sql, mid)) {
Main.replyJSON(request, response, "{\"status\":\"ok\"}");
} else {
response.sendError(400);
}
}
- public void doSetPopular(HttpServletRequest request, HttpServletResponse response, Stream xmpp) throws ServletException, IOException {
+ public void doSetPopular(HttpServletRequest request,
+ HttpServletResponse response, Stream xmpp)
+ throws ServletException, IOException {
int mid = Utils.parseInt(request.getParameter("mid"), 0);
int popular = Utils.parseInt(request.getParameter("popular"), 0);
@@ -123,7 +132,7 @@ public class Messages {
msg.from = new JID("juick", "juick.com", null);
msg.to = new JID(null, "crosspost.juick.com", null);
JuickMessage jmsg = new JuickMessage(m);
- jmsg.User.UID = 11574;
+ jmsg.setUser(UserQueries.getUserByUID(sql, 11574));
msg.childs.add(jmsg);
msg.to.Username = "twitter";