add member and remove member in a group

This commit is contained in:
2025-07-01 15:31:12 +03:30
parent ee037532a1
commit d3f449b8d2
3 changed files with 221 additions and 17 deletions
@@ -419,5 +419,21 @@ public class ChannelDatabase {
}
public static boolean isUserInChannel(UUID userId, UUID channelId) {
try (Connection conn = ConnectionDb.connect();
PreparedStatement stmt = conn.prepareStatement(
"SELECT 1 FROM channel_subscribers WHERE channel_id = ? AND user_id = ?")) {
stmt.setObject(1, channelId);
stmt.setObject(2, userId);
ResultSet rs = stmt.executeQuery();
return rs.next();
} catch (SQLException e) {
e.printStackTrace();
return false;
}
}
}