aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-09 20:37:30 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-09 20:37:30 +0100
commite67f7ecb404331bc660dadbce13505aab8f66eb0 (patch)
tree4ddb528b3eb64700408eee0f427cf04037af2e46 /src/main/java/de/pixart/messenger
parent63ceb05b3421eb8bd011645fd80620b4f694b916 (diff)
set last clear date to time of last message
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-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() {