aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/MessageArchiveService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/MessageArchiveService.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
index 351ded0b..ae81cc17 100644
--- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
+++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
@@ -54,6 +54,18 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
this.execute(query);
}
+ public void catchupMUC(final Conversation conversation) {
+ if (conversation.getLastMessageTransmitted() < 0 && conversation.countMessages() == 0) {
+ query(conversation,
+ 0,
+ System.currentTimeMillis());
+ } else {
+ query(conversation,
+ conversation.getLastMessageTransmitted(),
+ System.currentTimeMillis());
+ }
+ }
+
private long getLastMessageTransmitted(final Account account) {
long timestamp = 0;
for(final Conversation conversation : mXmppConnectionService.getConversations()) {