aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src/file_provider.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-11-14 16:59:21 +0100
committerfiaxh <git@lightrise.org>2020-11-14 17:05:46 +0100
commitd0488401cea54a78c8190c372d33a63440cc3aeb (patch)
treef48d0e14ad26589b65b390d3b06637a522070eaf /plugins/http-files/src/file_provider.vala
parentb8d216a0575fbdc5a8eeeed07a1aeda8bd83ffea (diff)
downloaddino-d0488401cea54a78c8190c372d33a63440cc3aeb.tar.gz
dino-d0488401cea54a78c8190c372d33a63440cc3aeb.zip
Use WeakMap for message caching
Diffstat (limited to 'plugins/http-files/src/file_provider.vala')
-rw-r--r--plugins/http-files/src/file_provider.vala4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala
index fd952b6b..0a68a1fb 100644
--- a/plugins/http-files/src/file_provider.vala
+++ b/plugins/http-files/src/file_provider.vala
@@ -114,7 +114,7 @@ public class FileProvider : Dino.FileProvider, Object {
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(file_transfer.counterpart.bare_jid, file_transfer.account);
if (conversation == null) throw new FileReceiveError.GET_METADATA_FAILED("No conversation");
- Message? message = dino_db.get_message_by_id(int.parse(file_transfer.info));
+ Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(int.parse(file_transfer.info), conversation);
if (message == null) throw new FileReceiveError.GET_METADATA_FAILED("No message");
var file_meta = new HttpFileMeta();
@@ -132,7 +132,7 @@ public class FileProvider : Dino.FileProvider, Object {
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(file_transfer.counterpart.bare_jid, file_transfer.account);
if (conversation == null) return null;
- Message? message = dino_db.get_message_by_id(int.parse(file_transfer.info));
+ Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(int.parse(file_transfer.info), conversation);
if (message == null) return null;
var receive_data = new HttpFileReceiveData();