diff options
author | 2016-06-29 15:09:47 +0300 | |
---|---|---|
committer | 2016-06-29 15:09:47 +0300 | |
commit | 797942249b0d5e38285e806bc0e73e755e6ffede (patch) | |
tree | 6d785d6b59fbc57d6e0e82af157df1abf3e853be /src/main/java/com/juick/server/MessagesQueries.java | |
parent | 87da42e3385e368f05d88ff125a78605a18f9cc3 (diff) |
add more bot queries
Diffstat (limited to 'src/main/java/com/juick/server/MessagesQueries.java')
-rw-r--r-- | src/main/java/com/juick/server/MessagesQueries.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java index cd098ec6..880e94e2 100644 --- a/src/main/java/com/juick/server/MessagesQueries.java +++ b/src/main/java/com/juick/server/MessagesQueries.java @@ -645,4 +645,15 @@ public class MessagesQueries { return sql.update("UPDATE messages SET privacy=1 WHERE message_id=?", mid) > 0; } + public static boolean deleteMessage(JdbcTemplate sql, int uid, int mid) { + if (sql.update("DELETE FROM messages WHERE message_id=? AND user_id=?", mid, uid) > 0) { + sql.update("DELETE FROM messages_txt WHERE message_id=?", mid); + sql.update("DELETE FROM replies WHERE message_id=?", mid); + sql.update("DELETE FROM subscr_messages WHERE message_id=?", mid); + sql.update("DELETE FROM messages_tags WHERE message_id=?", mid); + return true; + } + return false; + } + } |