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 Original line Diff line number Diff line
@@ -555,12 +555,20 @@ public class LocalMessage extends MimeMessage {


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


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


    @Override
    @Override