diff --git a/src/main/java/net/frozenorb/apiv3/model/Punishment.java b/src/main/java/net/frozenorb/apiv3/model/Punishment.java index ef62520..74bb994 100644 --- a/src/main/java/net/frozenorb/apiv3/model/Punishment.java +++ b/src/main/java/net/frozenorb/apiv3/model/Punishment.java @@ -60,6 +60,10 @@ public final class Punishment { return SyncUtils.blockOne(punishmentsCollection.find(new Document("_id", id))); } + public static Punishment findByLinkedIpBanIdSync(String id) { + return SyncUtils.blockOne(punishmentsCollection.find(new Document("linkedIpBanId", id))); + } + public static List findByUserSync(User user) { return findByUserSync(user.getId()); } @@ -94,6 +98,10 @@ public final class Punishment { punishmentsCollection.find(new Document("_id", id)).first(callback); } + public static void findByLinkedIpBanId(String id, SingleResultCallback callback) { + punishmentsCollection.find(new Document("linkedIpBanId", id)).first(callback); + } + public static void findByUser(User user, SingleResultCallback> callback) { findByUser(user.getId(), callback); } @@ -182,7 +190,7 @@ public final class Punishment { } public void linkIpBan(IpBan ipBan) { - + this.linkedIpBanId = ipBan.getId(); } public void insert() {