aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-17 21:31:25 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-17 21:31:25 +0100
commit9cd032cc7337c87bd1f38326d2497f8eed101de3 (patch)
treefdbfb3e06927026e08e669894df4acf7284fb9c2 /src/main/java/de/pixart
parent35fca6af27edb7c249814df4219edf96a2f24823 (diff)
work around -1 in next encryption
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 0d9ccd30f..5a3dd4cf4 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -52,7 +52,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
public static final String ATTRIBUTE_MUTED_TILL = "muted_till";
public static final String ATTRIBUTE_ALWAYS_NOTIFY = "always_notify";
public static final String ATTRIBUTE_CRYPTO_TARGETS = "crypto_targets";
- public static final String ATTRIBUTE_LAST_CLEAR_HISTORY = "last_clear_history";
+ public static final String ATTRIBUTE_LAST_CLEAR_HISTORY = "last_clear_history";
private String name;
private String contactUuid;
@@ -150,7 +150,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
if ((message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE)
&& message.getEncryption() != Message.ENCRYPTION_PGP) {
onMessageFound.onMessageFound(message);
- }
+ }
}
}
}
@@ -235,7 +235,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
if (message.getType() != Message.TYPE_IMAGE
&& message.getStatus() == Message.STATUS_UNSEND) {
onMessageFound.onMessageFound(message);
- }
+ }
}
}
}
@@ -381,16 +381,16 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
public Conversation(final String name, final Account account, final Jid contactJid,
- final int mode) {
+ final int mode) {
this(java.util.UUID.randomUUID().toString(), name, null, account
- .getUuid(), contactJid, System.currentTimeMillis(),
+ .getUuid(), contactJid, System.currentTimeMillis(),
STATUS_AVAILABLE, mode, "");
this.account = account;
}
public Conversation(final String uuid, final String name, final String contactUuid,
- final String accountUuid, final Jid contactJid, final long created, final int status,
- final int mode, final String attributes) {
+ final String accountUuid, final Jid contactJid, final long created, final int status,
+ final int mode, final String attributes) {
this.uuid = uuid;
this.name = name;
this.contactUuid = contactUuid;
@@ -432,7 +432,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
} else {
return this.messages.get(i);
}
- }
+ }
}
return null;
}
@@ -469,7 +469,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
return this.getContact().getDisplayName();
}
}
-
+
public String getParticipants() {
if (getMode() == MODE_MULTI) {
String generatedName = getMucOptions().createNameFromParticipants();
@@ -709,7 +709,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
public int getNextEncryption() {
- return this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, Message.ENCRYPTION_NONE);
+ return Math.max(this.getIntAttribute(ATTRIBUTE_NEXT_ENCRYPTION, Message.ENCRYPTION_NONE), Message.ENCRYPTION_NONE);
}
public void setNextEncryption(int encryption) {