Private
Public Access
1
0

2 Commits
1.3.1 ... 1.3.2

Author SHA1 Message Date
64d7394ffa gtk: fix attachment download race condition 2026-02-22 00:36:15 -08:00
69892a4d08 fix rpmspec 2026-02-22 00:24:36 -08:00
3 changed files with 13 additions and 8 deletions

View File

@@ -1,6 +1,5 @@
%global app_version %{!?app_version:1.3.0}
Name: kordophone Name: kordophone
Version: %{app_version} Version: %{?app_version}%{!?app_version:1.3.0}
Release: 1%{?dist} Release: 1%{?dist}
Summary: GTK4/Libadwaita client for Kordophone Summary: GTK4/Libadwaita client for Kordophone

View File

@@ -327,8 +327,8 @@ private class TranscriptDrawingArea : Widget
private void recompute_message_layouts() { private void recompute_message_layouts() {
var container_width = get_width(); var container_width = get_width();
float max_width = container_width * 0.90f; float max_width = container_width * 0.80f;
float image_max_width = max_width * 0.75f; float image_max_width = max_width * 0.70f;
DateTime? last_date = null; DateTime? last_date = null;
string? last_sender = null; string? last_sender = null;

View File

@@ -159,7 +159,6 @@ public class TranscriptView : Adw.Bin
} }
delegate void OpenPath(string path); delegate void OpenPath(string path);
private ulong attachment_downloaded_handler_id = 0;
private void open_attachment(string attachment_guid) { private void open_attachment(string attachment_guid) {
OpenPath open_path = (path) => { OpenPath open_path = (path) => {
try { try {
@@ -180,10 +179,17 @@ public class TranscriptView : Adw.Bin
// TODO: Should probably indicate progress here. // TODO: Should probably indicate progress here.
attachment_downloaded_handler_id = Repository.get_instance().attachment_downloaded.connect((guid) => { ulong handler_id = 0;
handler_id = Repository.get_instance().attachment_downloaded.connect((guid) => {
if (guid == attachment_guid) { if (guid == attachment_guid) {
open_path(attachment_info.path); try {
Repository.get_instance().disconnect(attachment_downloaded_handler_id); var updated_attachment_info = Repository.get_instance().get_attachment_info(attachment_guid);
open_path(updated_attachment_info.path);
} catch (GLib.Error e) {
warning("Failed to get attachment info after download: %s", e.message);
}
Repository.get_instance().disconnect(handler_id);
} }
}); });
} }