From 797942249b0d5e38285e806bc0e73e755e6ffede Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 29 Jun 2016 15:09:47 +0300 Subject: add more bot queries --- src/main/java/com/juick/server/MessagesQueries.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/com/juick/server/MessagesQueries.java') 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; + } + } -- cgit v1.2.3