From cf9198781f67237e325da036decd5e0898f5dcbd Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Thu, 26 Mar 2020 20:54:20 +0100 Subject: [PATCH] Implemented the setting of the received- and read-date of group messages --- src/main/java/envoy/data/GroupMessage.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/data/GroupMessage.java b/src/main/java/envoy/data/GroupMessage.java index c048fe4..5845c2a 100644 --- a/src/main/java/envoy/data/GroupMessage.java +++ b/src/main/java/envoy/data/GroupMessage.java @@ -43,7 +43,18 @@ public final class GroupMessage extends Message { this.memberStatuses = memberStatuses; } - public void updateStatus() { setStatus(Collections.min(memberStatuses.values())); } + public void updateStatus() { + setStatus(Collections.min(memberStatuses.values())); + switch (getStatus()) { + case RECEIVED: + setReceivedDate(new Date()); + break; + + case READ: + setReadDate(new Date()); + break; + } + } public Map getMemberStatuses() { return memberStatuses; } }