diff options
author | fiaxh <git@lightrise.org> | 2023-03-23 10:17:42 -0600 |
---|---|---|
committer | Marvin W <git@larma.de> | 2023-03-23 12:14:22 -0600 |
commit | 65efaca6fdcbc788060a0ecc4f7e10fbf5b79669 (patch) | |
tree | f35cbaf0bfd5d3ed0a48b5a7852c3dd507ab9d04 /main | |
parent | ef8fb0e94ce79d5fde2943e433ad0422eb7f70ec (diff) | |
download | dino-65efaca6fdcbc788060a0ecc4f7e10fbf5b79669.tar.gz dino-65efaca6fdcbc788060a0ecc4f7e10fbf5b79669.zip |
Fix images from another client in our account not being displayed right away
Diffstat (limited to 'main')
-rw-r--r-- | main/src/ui/conversation_content_view/file_widget.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/main/src/ui/conversation_content_view/file_widget.vala b/main/src/ui/conversation_content_view/file_widget.vala index 785acf7d..02c9407a 100644 --- a/main/src/ui/conversation_content_view/file_widget.vala +++ b/main/src/ui/conversation_content_view/file_widget.vala @@ -108,7 +108,7 @@ public class FileWidget : SizeRequestBox { } catch (Error e) { } } - if (state != State.DEFAULT) { + if (!show_image() && state != State.DEFAULT) { if (content != null) this.remove(content); FileDefaultWidget default_file_widget = new FileDefaultWidget(); default_widget_controller = new FileDefaultWidgetController(default_file_widget); @@ -121,8 +121,12 @@ public class FileWidget : SizeRequestBox { private bool show_image() { if (file_transfer.mime_type == null) return false; - if (file_transfer.state != FileTransfer.State.COMPLETE && - !(file_transfer.direction == FileTransfer.DIRECTION_SENT && file_transfer.state == FileTransfer.State.IN_PROGRESS)) { + + // If the image is being sent by this client, we already have the file + bool in_progress_from_us = file_transfer.direction == FileTransfer.DIRECTION_SENT && + file_transfer.ourpart.equals(file_transfer.account.full_jid) && + file_transfer.state == FileTransfer.State.IN_PROGRESS; + if (file_transfer.state != FileTransfer.State.COMPLETE && !in_progress_from_us) { return false; } |