aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-01-03 00:47:22 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-01-03 00:47:22 +0100
commit8bda54d48c185a1ce7787080fe6223d47377d55e (patch)
tree7e91ea7226a172d684f9e43f5449e3289cee1cec /src/main/java/eu/siacs/conversations/entities
parent969044b1133fa2fd82d209953a1970a2a5b2eb97 (diff)
code cleanup
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index a88984fb1..470bd2902 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -76,6 +76,16 @@ public class Conversation extends AbstractEntity implements Blockable {
private Bookmark bookmark;
+ private boolean messagesLeftOnServer = true;
+
+ public boolean hasMessagesLeftOnServer() {
+ return messagesLeftOnServer;
+ }
+
+ public void setHasMessagesLeftOnServer(boolean value) {
+ this.messagesLeftOnServer = value;
+ }
+
public Message findUnsentMessageWithUuid(String uuid) {
synchronized(this.messages) {
for (final Message message : this.messages) {
@@ -227,13 +237,10 @@ public class Conversation extends AbstractEntity implements Blockable {
}
public boolean isRead() {
- return (this.messages == null) || (this.messages.size() == 0) || this.messages.get(this.messages.size() - 1).isRead();
+ return (this.messages.size() == 0) || this.messages.get(this.messages.size() - 1).isRead();
}
public void markRead() {
- if (this.messages == null) {
- return;
- }
for (int i = this.messages.size() - 1; i >= 0; --i) {
if (messages.get(i).isRead()) {
break;
@@ -243,9 +250,6 @@ public class Conversation extends AbstractEntity implements Blockable {
}
public Message getLatestMarkableMessage() {
- if (this.messages == null) {
- return null;
- }
for (int i = this.messages.size() - 1; i >= 0; --i) {
if (this.messages.get(i).getStatus() <= Message.STATUS_RECEIVED
&& this.messages.get(i).markable) {
@@ -260,7 +264,7 @@ public class Conversation extends AbstractEntity implements Blockable {
}
public Message getLatestMessage() {
- if ((this.messages == null) || (this.messages.size() == 0)) {
+ if (this.messages.size() == 0) {
Message message = new Message(this, "", Message.ENCRYPTION_NONE);
message.setTime(getCreated());
return message;