diff options
author | Marvin W <git@larma.de> | 2019-12-22 04:10:53 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-12-23 16:58:53 +0100 |
commit | a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d (patch) | |
tree | cbb079649066c2001b6d6881137108e70eed9d3f /libdino/src/service/file_manager.vala | |
parent | 3218dc0211ac717230fe03fad82681a626d968b5 (diff) | |
download | dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.tar.gz dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.zip |
Properly check Jids everywhere
Diffstat (limited to 'libdino/src/service/file_manager.vala')
-rw-r--r-- | libdino/src/service/file_manager.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala index a7d7b94a..5f3db040 100644 --- a/libdino/src/service/file_manager.vala +++ b/libdino/src/service/file_manager.vala @@ -169,8 +169,12 @@ public class FileManager : StreamInteractionModule, Object { private Gee.List<FileTransfer> get_transfers_from_qry(Qlite.QueryBuilder select) { Gee.List<FileTransfer> ret = new ArrayList<FileTransfer>(); foreach (Qlite.Row row in select) { - FileTransfer file_transfer = new FileTransfer.from_row(db, row, get_storage_dir()); - ret.insert(0, file_transfer); + try { + FileTransfer file_transfer = new FileTransfer.from_row(db, row, get_storage_dir()); + ret.insert(0, file_transfer); + } catch (InvalidJidError e) { + warning("Ignoring file transfer with invalid Jid: %s", e.message); + } } return ret; } @@ -287,7 +291,7 @@ public class FileManager : StreamInteractionModule, Object { if (conversation.type_ in new Conversation.Type[]{Conversation.Type.GROUPCHAT, Conversation.Type.GROUPCHAT_PM}) { file_transfer.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account) ?? conversation.account.bare_jid; } else { - file_transfer.ourpart = conversation.account.bare_jid.with_resource(conversation.account.resourcepart); + file_transfer.ourpart = conversation.account.full_jid; } file_transfer.time = time; file_transfer.local_time = local_time; |