aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server/UserQueries.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-11-20 04:14:35 +0700
committerGravatar Ugnich Anton2013-11-20 04:14:35 +0700
commit4844ef8ea55d8b88619af8400df1bbf690842f7f (patch)
treed1745503229b0a621016137ddcfaa86933197516 /src/com/juick/server/UserQueries.java
parente59500659d5068557337e94dbf8d0955f08c6869 (diff)
UserQueries.isInBLAny; PMQueries lastmessage time fix
Diffstat (limited to 'src/com/juick/server/UserQueries.java')
-rw-r--r--src/com/juick/server/UserQueries.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/juick/server/UserQueries.java b/src/com/juick/server/UserQueries.java
index f127cbca..b1198e4d 100644
--- a/src/com/juick/server/UserQueries.java
+++ b/src/com/juick/server/UserQueries.java
@@ -425,6 +425,29 @@ public class UserQueries {
return ret;
}
+ public static boolean isInBLAny(Connection sql, int uid, int uid2) {
+ boolean ret = false;
+
+ PreparedStatement stmt = null;
+ ResultSet rs = null;
+ try {
+ stmt = sql.prepareStatement("SELECT 1 FROM bl_users WHERE (user_id=? AND bl_user_id=?) OR (user_id=? AND bl_user_id=?)");
+ stmt.setInt(1, uid);
+ stmt.setInt(2, uid2);
+ stmt.setInt(3, uid2);
+ stmt.setInt(4, uid);
+ rs = stmt.executeQuery();
+ if (rs.first()) {
+ ret = rs.getInt(1) == 1;
+ }
+ } catch (SQLException e) {
+ System.err.println(e);
+ } finally {
+ Utils.finishSQL(rs, stmt);
+ }
+ return ret;
+ }
+
public static ArrayList<Integer> checkBL(Connection sql, int visitor, ArrayList<Integer> uids) {
ArrayList<Integer> ret = new ArrayList<Integer>();