Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0d09b91 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

clarify code for LocalMessage.equals()

parent 21899e18
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -555,12 +555,20 @@ public class LocalMessage extends MimeMessage {

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }

        final LocalMessage that = (LocalMessage) o;
        return !(getAccountUuid() != null ? !getAccountUuid().equals(that.getAccountUuid()) : that.getAccountUuid() != null);
        // distinguish by account uuid, in addition to what Message.equals() does above
        String thisAccountUuid = getAccountUuid();
        String thatAccountUuid = ((LocalMessage) o).getAccountUuid();
        return thisAccountUuid != null ? thisAccountUuid.equals(thatAccountUuid) : thatAccountUuid == null;
    }

    @Override