aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-02-12 19:47:25 +0100
committerfiaxh <git@lightrise.org>2020-02-20 16:54:35 +0100
commitca264c42adc8147e66b90b748009f9f45d79cde9 (patch)
tree3776b0a1dfba995d9987fa9a2f7444d782ab8d0d /libdino/src/service
parent29bcba2580acbc039897e61898dc1d9219f175bc (diff)
downloaddino-ca264c42adc8147e66b90b748009f9f45d79cde9.tar.gz
dino-ca264c42adc8147e66b90b748009f9f45d79cde9.zip
Correctly set direction in file transfers in MUCs
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/file_manager.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala
index d0cabea7..54579a04 100644
--- a/libdino/src/service/file_manager.vala
+++ b/libdino/src/service/file_manager.vala
@@ -290,12 +290,13 @@ public class FileManager : StreamInteractionModule, Object {
private async void handle_incoming_file(FileProvider file_provider, string info, Jid from, DateTime time, DateTime local_time, Conversation conversation, FileReceiveData receive_data, FileMeta file_meta) {
FileTransfer file_transfer = new FileTransfer();
file_transfer.account = conversation.account;
- file_transfer.direction = from.bare_jid.equals(conversation.account.bare_jid) ? FileTransfer.DIRECTION_SENT : FileTransfer.DIRECTION_RECEIVED;
file_transfer.counterpart = file_transfer.direction == FileTransfer.DIRECTION_RECEIVED ? from : conversation.counterpart;
if (conversation.type_.is_muc_semantic()) {
file_transfer.ourpart = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account) ?? conversation.account.bare_jid;
+ file_transfer.direction = from.equals(file_transfer.ourpart) ? FileTransfer.DIRECTION_SENT : FileTransfer.DIRECTION_RECEIVED;
} else {
file_transfer.ourpart = conversation.account.full_jid;
+ file_transfer.direction = from.equals_bare(file_transfer.ourpart) ? FileTransfer.DIRECTION_SENT : FileTransfer.DIRECTION_RECEIVED;
}
file_transfer.time = time;
file_transfer.local_time = local_time;