preparing display of selcted message
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -52,6 +52,17 @@ public class Envelope {
|
||||
return new Envelope(message,receivers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (!(o instanceof Envelope envelope)) return false;
|
||||
return message.equals(envelope.message) && time.equals(envelope.time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * message.hashCode() + time.hashCode();
|
||||
}
|
||||
|
||||
public boolean isFor(User receiver) {
|
||||
return receivers.contains(receiver);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@ import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
||||
import static de.srsoftware.umbrella.core.model.Translatable.t;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import de.srsoftware.tools.Mappable;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import java.util.*;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public record Message(UmbrellaUser sender, Translatable subject, Translatable body, List<Attachment> attachments) {
|
||||
public record Message(UmbrellaUser sender, Translatable subject, Translatable body, List<Attachment> attachments) {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof Message message)) return false;
|
||||
|
||||
Reference in New Issue
Block a user