Implements attachments display in transcript
This commit is contained in:
@@ -4,6 +4,7 @@ using Gee;
|
||||
public class Repository : DBusServiceProxy {
|
||||
public signal void conversations_updated();
|
||||
public signal void messages_updated(string conversation_guid);
|
||||
public signal void attachment_downloaded(string attachment_guid);
|
||||
|
||||
public static Repository get_instance() {
|
||||
if (instance == null) {
|
||||
@@ -36,6 +37,10 @@ public class Repository : DBusServiceProxy {
|
||||
messages_updated(conversation_guid);
|
||||
});
|
||||
|
||||
this.dbus_repository.attachment_download_completed.connect((attachment_guid) => {
|
||||
attachment_downloaded(attachment_guid);
|
||||
});
|
||||
|
||||
conversations_updated();
|
||||
} catch (GLib.Error e) {
|
||||
warning("Failed to connect to repository: %s", e.message);
|
||||
@@ -87,4 +92,12 @@ public class Repository : DBusServiceProxy {
|
||||
|
||||
dbus_repository.sync_conversation(conversation_guid);
|
||||
}
|
||||
|
||||
public void download_attachment(string attachment_guid, bool preview) throws DBusServiceProxyError, GLib.Error {
|
||||
if (dbus_repository == null) {
|
||||
throw new DBusServiceProxyError.NOT_CONNECTED("Repository not connected");
|
||||
}
|
||||
|
||||
dbus_repository.download_attachment(attachment_guid, preview);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user