diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-20 12:52:08 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-20 12:52:08 +0100 |
commit | 88f43643bf92b5f5e54be5a9ec98409c30b83ec5 (patch) | |
tree | 1ef66f658982af424d1c78f240a363272a52ea5a /src/main/java/eu/siacs/conversations/services | |
parent | 675bac7255604d3db7aa10a5e2ace9673ce2d9f4 (diff) |
inject ui callback into running mam query
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/MessageArchiveService.java | 5 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index 1d80690c8..1a161c565 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -151,10 +151,13 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { } } - public boolean queryInProgress(Conversation conversation) { + public boolean queryInProgress(Conversation conversation, XmppConnectionService.OnMoreMessagesLoaded callback) { synchronized (this.queries) { for(Query query : queries) { if (query.conversation == conversation) { + if (!query.hasCallback() && callback != null) { + query.setCallback(callback); + } return true; } } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 39babecea..1273ae860 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -963,7 +963,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa public void loadMoreMessages(final Conversation conversation, final long timestamp, final OnMoreMessagesLoaded callback) { Log.d(Config.LOGTAG,"load more messages for "+conversation.getName() + " prior to "+MessageGenerator.getTimestamp(timestamp)); - if (XmppConnectionService.this.getMessageArchiveService().queryInProgress(conversation)) { + if (XmppConnectionService.this.getMessageArchiveService().queryInProgress(conversation,callback)) { return; } new Thread(new Runnable() { |