aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/entities
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/de/gultsch/chat/entities/Conversation.java2
-rw-r--r--src/de/gultsch/chat/entities/Message.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/de/gultsch/chat/entities/Conversation.java b/src/de/gultsch/chat/entities/Conversation.java
index bddd1356..e0e5623c 100644
--- a/src/de/gultsch/chat/entities/Conversation.java
+++ b/src/de/gultsch/chat/entities/Conversation.java
@@ -73,7 +73,7 @@ public class Conversation extends AbstractEntity {
}
public boolean isRead() {
- if (this.messages == null) return true;
+ if ((this.messages == null)||(this.messages.size() == 0)) return true;
return this.messages.get(this.messages.size() - 1).isRead();
}
diff --git a/src/de/gultsch/chat/entities/Message.java b/src/de/gultsch/chat/entities/Message.java
index d53e93c1..a168c645 100644
--- a/src/de/gultsch/chat/entities/Message.java
+++ b/src/de/gultsch/chat/entities/Message.java
@@ -127,5 +127,9 @@ public class Message extends AbstractEntity {
public void markUnread() {
this.read = false;
}
+
+ public void setTime(long time) {
+ this.timeSent = time;
+ }
}