aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 4c6dd9ccd..a97a0d78b 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -3733,9 +3733,15 @@ public class XmppConnectionService extends Service {
}
public void clearConversationHistory(final Conversation conversation) {
+ long clearDate;
+ if (conversation.countMessages() > 0) {
+ clearDate = conversation.getLatestMessage().getTimeSent() + 1000;
+ } else {
+ clearDate = System.currentTimeMillis();
+ }
conversation.clearMessages();
conversation.setHasMessagesLeftOnServer(false); //avoid messages getting loaded through mam
- conversation.setLastClearHistory(System.currentTimeMillis());
+ conversation.setLastClearHistory(clearDate);
Runnable runnable = new Runnable() {
@Override
public void run() {