From 02b7b0b4a699acd944e6f73ecb7d4fe5252ee410 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 18 Aug 2018 18:20:58 +0200 Subject: [PATCH] do grace period calculation only on positive periods --- src/main/java/eu/siacs/conversations/entities/Account.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index 9aa3c0b72..0e98586b7 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -604,8 +604,10 @@ public class Account extends AbstractEntity { return this.avatar; } - public void activateGracePeriod(long duration) { - this.mEndGracePeriod = SystemClock.elapsedRealtime() + duration; + public void activateGracePeriod(final long duration) { + if (duration > 0) { + this.mEndGracePeriod = SystemClock.elapsedRealtime() + duration; + } } public void deactivateGracePeriod() {