Commit e6e14693 authored by Tiago Cunha's avatar Tiago Cunha Committed by GitHub

Merge branch 'develop' into feature/untengle-modules

parents 9ac83d10 7c3b692d
......@@ -10,7 +10,7 @@ public class RealmPreferences extends RealmObject {
@PrimaryKey private String id;
private boolean newRoomNotification;
private String newRoomNotification;
private boolean newMessageNotification;
private boolean useEmojis;
private boolean convertAsciiEmoji;
......@@ -48,7 +48,7 @@ public class RealmPreferences extends RealmObject {
.build();
}
public boolean isNewRoomNotification() {
public String getNewRoomNotification() {
return newRoomNotification;
}
......@@ -119,7 +119,8 @@ public class RealmPreferences extends RealmObject {
RealmPreferences that = (RealmPreferences) o;
if (newRoomNotification != that.newRoomNotification) {
if (newRoomNotification != null ? newRoomNotification.equals(that.newRoomNotification)
: that.newRoomNotification == null) {
return false;
}
if (newMessageNotification != that.newMessageNotification) {
......@@ -172,7 +173,7 @@ public class RealmPreferences extends RealmObject {
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (newRoomNotification ? 1 : 0);
result = 31 * result + (newRoomNotification != null ? newRoomNotification.hashCode() : 0);
result = 31 * result + (newMessageNotification ? 1 : 0);
result = 31 * result + (useEmojis ? 1 : 0);
result = 31 * result + (convertAsciiEmoji ? 1 : 0);
......
......@@ -2,12 +2,15 @@ package chat.rocket.core.models;
import com.google.auto.value.AutoValue;
import javax.annotation.Nullable;
@AutoValue
public abstract class Preferences {
public abstract String getId();
public abstract boolean isNewRoomNotification();
@Nullable
public abstract String getNewRoomNotification();
public abstract boolean isNewMessageNotification();
......@@ -46,7 +49,7 @@ public abstract class Preferences {
public abstract Builder setId(String id);
public abstract Builder setNewRoomNotification(boolean newRoomNotification);
public abstract Builder setNewRoomNotification(String newRoomNotification);
public abstract Builder setNewMessageNotification(boolean newMessageNotification);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment