From c511e482d34d9315c06da004f8ceb1ea1d9de4ec 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; } }