diff options
author | Ugnich Anton | 2014-04-23 21:27:46 +0700 |
---|---|---|
committer | Ugnich Anton | 2014-04-23 21:27:46 +0700 |
commit | 3406753be46b637c0afee894cb12ed1bc5de9d29 (patch) | |
tree | 95a541edb549b01e328b6602fe8a41c19c0d5ff8 /src/com/juick/server/MessagesQueries.java | |
parent | 29df00e4fa77ba4aeda0b9780e30c17dd57d92b2 (diff) |
Recommendations (getJIDSubscribedToUserRecommendations)
Diffstat (limited to 'src/com/juick/server/MessagesQueries.java')
-rw-r--r-- | src/com/juick/server/MessagesQueries.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java index 550da56d..d02985ee 100644 --- a/src/com/juick/server/MessagesQueries.java +++ b/src/com/juick/server/MessagesQueries.java @@ -138,6 +138,14 @@ public class MessagesQueries { return rid; } + public static boolean recommendMessage(Connection sql, int mid, int vuid) { + boolean res = SQLHelpers.execute(sql, "INSERT IGNORE INTO favorites(user_id,message_id) VALUES (" + vuid + "," + mid + ")") == 1; + if (res) { + SQLHelpers.executeInt(sql, "UPDATE messages SET likes=likes+1 WHERE message_id=?", mid); + } + return res; + } + public static boolean canViewThread(Connection sql, int mid, int uid) { int privacy = 0; |