diff options
author | mesonium <93607429+mesonium@users.noreply.github.com> | 2021-11-18 23:11:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 23:11:29 +0100 |
commit | e7500138a97500e155f6f7435c29874e1391b318 (patch) | |
tree | c783644dd572d0b5bc666ce7b175e75a6840559b /libdino/src/service | |
parent | 8339d95621530664b8306b8b033976529510ed17 (diff) | |
download | dino-e7500138a97500e155f6f7435c29874e1391b318.tar.gz dino-e7500138a97500e155f6f7435c29874e1391b318.zip |
Fix auto download if public MUC JID is in roster (#1137)
Dino has downloaded files (< 5 MB) automatically from occupants in public MUCs if the public MUC JID was in the user's roster. This patch fixes it.
Diffstat (limited to 'libdino/src/service')
-rw-r--r-- | libdino/src/service/file_manager.vala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala index 19d51b44..a478695c 100644 --- a/libdino/src/service/file_manager.vala +++ b/libdino/src/service/file_manager.vala @@ -176,7 +176,13 @@ public class FileManager : StreamInteractionModule, Object { public bool is_sender_trustworthy(FileTransfer file_transfer, Conversation conversation) { if (file_transfer.direction == FileTransfer.DIRECTION_SENT) return true; - Jid relevant_jid = stream_interactor.get_module(MucManager.IDENTITY).get_real_jid(file_transfer.from, conversation.account) ?? conversation.counterpart; + + Jid relevant_jid = conversation.counterpart; + if (conversation.type_ == Conversation.Type.GROUPCHAT) { + relevant_jid = stream_interactor.get_module(MucManager.IDENTITY).get_real_jid(file_transfer.from, conversation.account); + } + if (relevant_jid == null) return false; + bool in_roster = stream_interactor.get_module(RosterManager.IDENTITY).get_roster_item(conversation.account, relevant_jid) != null; return in_roster; } |