Ignore-System initial push #93
@ -15,17 +15,17 @@ public class IgnoreSystem{
|
||||
|
||||
public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) {
|
||||
try {
|
||||
return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next();
|
||||
return !SQL.select("SELECT * FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next();
|
||||
} catch (SQLException e) {
|
||||
throw new SecurityException("Could not check if ignored", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) {
|
||||
SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId());
|
||||
SQL.update("INSERT INTO IgnoredPlayers (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId());
|
||||
}
|
||||
|
||||
public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) {
|
||||
SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId());
|
||||
SQL.update("DELETE FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId());
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren