aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/PMQueries.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-15 22:56:33 +0300
committerGravatar Vitaly Takmazov2016-01-15 22:56:33 +0300
commit09fd6b8ee40802eceff9746d3c23aa8446ccbd64 (patch)
tree731b42333ab3bb29aed804988a7be597dcc45db2 /src/main/java/com/juick/server/PMQueries.java
parentf14eea2cfc80dac5e9b304a57457e7f82842a8ed (diff)
update core
Diffstat (limited to 'src/main/java/com/juick/server/PMQueries.java')
-rw-r--r--src/main/java/com/juick/server/PMQueries.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main/java/com/juick/server/PMQueries.java b/src/main/java/com/juick/server/PMQueries.java
index d49bb527..7984844a 100644
--- a/src/main/java/com/juick/server/PMQueries.java
+++ b/src/main/java/com/juick/server/PMQueries.java
@@ -104,7 +104,7 @@ public class PMQueries {
+ "WHERE user_id_to=? AND unread>0 "
+ "ORDER BY lastmessage DESC LIMIT " + cnt, (rs, rowNum) -> {
com.juick.User u = new com.juick.User();
- u.UID = rs.getInt(1);
+ u.setUID(rs.getInt(1));
u.MessagesCount = rs.getInt(2);
return u;
}, new Object[]{uid});
@@ -116,11 +116,11 @@ public class PMQueries {
+ "ORDER BY lastmessage DESC LIMIT ?", (rs, num) -> {
User u = new com.juick.User();
int uuid = rs.getInt(1) + rs.getInt(2) - uid;
- u.UID = uuid;
+ u.setUID(uuid);
return u;
}, new Object[]{uid, uid, cnt * 2});
for (User addUser : addUsers) {
- if (!haveUserInArray(users, addUser.UID)) {
+ if (!haveUserInArray(users, addUser.getUID())) {
users.add(addUser);
if (users.size() >= cnt) {
break;
@@ -137,7 +137,7 @@ public class PMQueries {
public static boolean haveUserInArray(List<com.juick.User> arr, int uid) {
for (User user : arr) {
- if (user.UID == uid) {
+ if (user.getUID() == uid) {
return true;
}
}
@@ -151,9 +151,9 @@ public class PMQueries {
(rs, rowNum) -> {
com.juick.Message msg = new com.juick.Message();
int uuid = rs.getInt(1);
- msg.User = new com.juick.User();
- msg.User.UID = uuid;
- msg.Text = rs.getString(2);
+ msg.setUser(new User());
+ msg.getUser().setUID(uuid);
+ msg.setText(rs.getString(2));
msg.TimestampString = rs.getString(3);
return msg;
}, new Object[]{uid, uid_to, uid, uid_to});
@@ -176,10 +176,10 @@ public class PMQueries {
rs.beforeFirst();
while (rs.next()) {
com.juick.Message msg = new com.juick.Message();
- msg.User = new com.juick.User();
- msg.User.UID = rs.getInt(1);
- msg.User.UName = rs.getString(2);
- msg.Text = rs.getString(3);
+ msg.setUser(new User());
+ msg.getUser().setUID(rs.getInt(1));
+ msg.getUser().setUName(rs.getString(2));
+ msg.setText(rs.getString(3));
msg.TimeAgo = rs.getInt(4);
msg.TimestampString = rs.getString(5);
msgs.add(0, msg);
@@ -205,10 +205,10 @@ public class PMQueries {
rs.beforeFirst();
while (rs.next()) {
com.juick.Message msg = new com.juick.Message();
- msg.User = new com.juick.User();
- msg.User.UID = rs.getInt(1);
- msg.User.UName = rs.getString(2);
- msg.Text = rs.getString(3);
+ msg.setUser(new User());
+ msg.getUser().setUID(rs.getInt(1));
+ msg.getUser().setUName(rs.getString(2));
+ msg.setText(rs.getString(3));
msg.TimeAgo = rs.getInt(4);
msg.TimestampString = rs.getString(5);
msgs.add(0, msg);