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 11235ba0b0
commit cf9198781f

View File

@ -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<Long, MessageStatus> getMemberStatuses() { return memberStatuses; }
}