X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Futil%2FNotary.java;h=901e5ef62e46891479bf7af5f12d827d0bd4a1db;hb=8c9012b3054bc5785c68ca17e1372e88a9120c70;hp=c3a889ab4ac12a6ed5a3ce763a002c23df800083;hpb=6b7d6a59d006d1d252ccbe86a4f5ab7099c6c002;p=gigi.git diff --git a/src/org/cacert/gigi/util/Notary.java b/src/org/cacert/gigi/util/Notary.java index c3a889ab..901e5ef6 100644 --- a/src/org/cacert/gigi/util/Notary.java +++ b/src/org/cacert/gigi/util/Notary.java @@ -13,6 +13,7 @@ import org.cacert.gigi.dbObjects.Group; import org.cacert.gigi.dbObjects.Name; import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.output.DateSelector; +import org.cacert.gigi.output.template.SprintfCommand; public class Notary { @@ -72,7 +73,7 @@ public class Notary { * @throws GigiApiException * if the assurance fails (for various reasons) */ - public synchronized static void assure(User assurer, User assuree, Name assureeName, Date dob, int awarded, String location, String date, AssuranceType type) throws GigiApiException { + public synchronized static void assure(User assurer, User assuree, Name assureeName, DayDate dob, int awarded, String location, String date, AssuranceType type) throws GigiApiException { may(assurer, assuree, AssuranceType.FACE_TO_FACE); GigiApiException gae = new GigiApiException(); if ( !gae.isEmpty()) { @@ -135,7 +136,7 @@ public class Notary { } else if (type == AssuranceType.TTP_ASSISTED) { assureTTP(assurer, assuree, awarded, location, date); } else { - throw new GigiApiException("Unknown Assurance type: " + type); + throw new GigiApiException(SprintfCommand.createSimple("Unknown Assurance type: {0}", type.toString())); } assurer.invalidateMadeAssurances(); assuree.invalidateReceivedAssurances(); @@ -197,7 +198,7 @@ public class Notary { private static void assureNucleus(User assurer, User assuree, int awarded, String location, String date) throws GigiApiException { may(assurer, assuree, AssuranceType.NUCLEUS); // Do up to 35 points as f2f - int f2fPoints = Math.min(35, awarded); + int f2fPoints = Math.min(assurer.getMaxAssurePoints(), awarded); assureF2F(assurer, assuree, f2fPoints, location, date); awarded -= f2fPoints;