diff options
author | 2016-01-15 22:56:33 +0300 | |
---|---|---|
committer | 2016-01-15 22:56:33 +0300 | |
commit | 09fd6b8ee40802eceff9746d3c23aa8446ccbd64 (patch) | |
tree | 731b42333ab3bb29aed804988a7be597dcc45db2 /src/main/java/com/juick/server/MessagesQueries.java | |
parent | f14eea2cfc80dac5e9b304a57457e7f82842a8ed (diff) |
update core
Diffstat (limited to 'src/main/java/com/juick/server/MessagesQueries.java')
-rw-r--r-- | src/main/java/com/juick/server/MessagesQueries.java | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java index 4086cb13..9cbf4240 100644 --- a/src/main/java/com/juick/server/MessagesQueries.java +++ b/src/main/java/com/juick/server/MessagesQueries.java @@ -244,10 +244,10 @@ public class MessagesQueries { + "WHERE messages.message_id=?", new Object[]{mid}, (rs, rowNum) -> { Message msg = new Message(); - msg.MID = mid; - msg.User = new com.juick.User(); - msg.User.UID = rs.getInt(1); - msg.User.UName = rs.getString(2); + msg.setMID(mid); + msg.setUser(new User()); + msg.getUser().setUID(rs.getInt(1)); + msg.getUser().setUName(rs.getString(2)); msg.TimeAgo = rs.getInt(3); msg.TimestampString = rs.getString(4); msg.ReadOnly = rs.getBoolean(5); @@ -267,7 +267,7 @@ public class MessagesQueries { msg.Hidden = rs.getBoolean(13); msg.parseTags(rs.getString(14)); msg.RepliesBy = rs.getString(15); - msg.Text = rs.getString(16); + msg.setText(rs.getString(16)); return msg; }); } @@ -280,15 +280,15 @@ public class MessagesQueries { + "WHERE replies.message_id=? AND replies.reply_id=?", new Object[]{mid, rid}, (rs, num) -> { Message msg = new Message(); - msg.MID = mid; - msg.RID = rid; - msg.User = new com.juick.User(); - msg.User.UID = rs.getInt(1); - msg.User.UName = rs.getString(2); + msg.setMID(mid); + msg.setRID(rid); + msg.setUser(new User()); + msg.getUser().setUID(rs.getInt(1)); + msg.getUser().setUName(rs.getString(2)); msg.ReplyTo = rs.getInt(3); msg.TimestampString = rs.getString(4); msg.AttachmentType = rs.getString(5); - msg.Text = rs.getString(6); + msg.setText(rs.getString(6)); return msg; }); } @@ -299,8 +299,8 @@ public class MessagesQueries { + "ON messages.user_id=users.id WHERE messages.message_id=?", new Object[]{mid}, (rs, num) -> { User res = new com.juick.User(); - res.UID = rs.getInt(1); - res.UName = rs.getString(2); + res.setUID(rs.getInt(1)); + res.setUName(rs.getString(2)); return res; }); } @@ -893,18 +893,18 @@ public class MessagesQueries { + "IN (" + Utils.convertArrayInt2String(mids) + ") " + "ORDER BY messages.message_id DESC", (rs, rowNum) -> { com.juick.Message msg = new com.juick.Message(); - msg.User = new com.juick.User(); + msg.setUser(new User()); - msg.MID = rs.getInt(1); - msg.User.UID = rs.getInt(2); - msg.User.UName = rs.getString(3); + msg.setMID(rs.getInt(1)); + msg.getUser().setUID(rs.getInt(2)); + msg.getUser().setUName(rs.getString(3)); if (rs.getString(4) != null) { msg.parseTags(rs.getString(4)); } msg.ReadOnly = rs.getInt(5) == 1; msg.Privacy = rs.getInt(6); msg.FriendsOnly = msg.Privacy < 0; - msg.Text = rs.getString(7); + msg.setText(rs.getString(7)); msg.TimeAgo = rs.getInt(8); msg.TimestampString = rs.getString(9); msg.Replies = rs.getInt(10); @@ -932,14 +932,14 @@ public class MessagesQueries { rs.beforeFirst(); while (rs.next()) { com.juick.Message msg = new com.juick.Message(); - msg.MID = mid; - msg.RID = rs.getInt(1); + msg.setMID(mid); + msg.setRID(rs.getInt(1)); msg.ReplyTo = rs.getInt(2); - msg.User = new com.juick.User(); - msg.User.UID = rs.getInt(3); - msg.User.UName = rs.getString(4); - msg.User.Banned = rs.getBoolean(5); - msg.Text = rs.getString(6); + msg.setUser(new User()); + msg.getUser().setUID(rs.getInt(3)); + msg.getUser().setUName(rs.getString(4)); + msg.getUser().Banned = rs.getBoolean(5); + msg.setText(rs.getString(6)); msg.TimeAgo = rs.getInt(7); msg.TimestampString = rs.getString(8); msg.AttachmentType = rs.getString(9); |