Implements marking conversations as read when clicked on
This commit is contained in:
@@ -45,6 +45,7 @@ public class MainWindow : Adw.ApplicationWindow
|
|||||||
transcript_view.title = conversation.display_name;
|
transcript_view.title = conversation.display_name;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Repository.get_instance().mark_conversation_as_read(conversation.guid);
|
||||||
Repository.get_instance().sync_conversation(conversation.guid);
|
Repository.get_instance().sync_conversation(conversation.guid);
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
GLib.warning("Failed to sync conversation: %s", e.message);
|
GLib.warning("Failed to sync conversation: %s", e.message);
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ namespace DBusService {
|
|||||||
[DBus (name = "SyncConversation")]
|
[DBus (name = "SyncConversation")]
|
||||||
public abstract void sync_conversation(string conversation_id) throws DBusError, IOError;
|
public abstract void sync_conversation(string conversation_id) throws DBusError, IOError;
|
||||||
|
|
||||||
|
[DBus (name = "MarkConversationAsRead")]
|
||||||
|
public abstract void mark_conversation_as_read(string conversation_id) throws DBusError, IOError;
|
||||||
|
|
||||||
[DBus (name = "ConversationsUpdated")]
|
[DBus (name = "ConversationsUpdated")]
|
||||||
public signal void conversations_updated();
|
public signal void conversations_updated();
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,12 @@
|
|||||||
value="Initiates a background sync of a single conversation with the server."/>
|
value="Initiates a background sync of a single conversation with the server."/>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
|
<method name="MarkConversationAsRead">
|
||||||
|
<arg type="s" name="conversation_id" direction="in"/>
|
||||||
|
<annotation name="org.freedesktop.DBus.DocString"
|
||||||
|
value="Marks a conversation as read."/>
|
||||||
|
</method>
|
||||||
|
|
||||||
<signal name="ConversationsUpdated">
|
<signal name="ConversationsUpdated">
|
||||||
<annotation name="org.freedesktop.DBus.DocString"
|
<annotation name="org.freedesktop.DBus.DocString"
|
||||||
value="Emitted when the list of conversations is updated."/>
|
value="Emitted when the list of conversations is updated."/>
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ public class Repository : DBusServiceProxy {
|
|||||||
dbus_repository.sync_conversation(conversation_guid);
|
dbus_repository.sync_conversation(conversation_guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mark_conversation_as_read(string conversation_guid) throws DBusServiceProxyError, GLib.Error {
|
||||||
|
if (dbus_repository == null) {
|
||||||
|
throw new DBusServiceProxyError.NOT_CONNECTED("Repository not connected");
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus_repository.mark_conversation_as_read(conversation_guid);
|
||||||
|
}
|
||||||
|
|
||||||
public void download_attachment(string attachment_guid, bool preview) throws DBusServiceProxyError, GLib.Error {
|
public void download_attachment(string attachment_guid, bool preview) throws DBusServiceProxyError, GLib.Error {
|
||||||
if (dbus_repository == null) {
|
if (dbus_repository == null) {
|
||||||
throw new DBusServiceProxyError.NOT_CONNECTED("Repository not connected");
|
throw new DBusServiceProxyError.NOT_CONNECTED("Repository not connected");
|
||||||
|
|||||||
Reference in New Issue
Block a user