Implemented the setting of the received- and read-date of group messages

This commit is contained in:
DieGurke 2020-03-26 20:54:20 +01:00
parent f128c2f307
commit c511e482d3

View File

@ -43,7 +43,18 @@ public final class GroupMessage extends Message {
this.memberStatuses = memberStatuses; 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<Long, MessageStatus> getMemberStatuses() { return memberStatuses; } public Map<Long, MessageStatus> getMemberStatuses() { return memberStatuses; }
} }