diff options
author | fiaxh <git@mx.ax.lt> | 2017-12-14 02:01:55 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-12-30 13:10:06 +0100 |
commit | b4bb0912fc328bc44b13e190f59b347eb5d4310a (patch) | |
tree | a18f680f8349eb758dd54fd44321837bcd228545 /libdino/src/application.vala | |
parent | f25fadde2d6c9492b9cafe2cddbcc7b966942e47 (diff) | |
download | dino-b4bb0912fc328bc44b13e190f59b347eb5d4310a.tar.gz dino-b4bb0912fc328bc44b13e190f59b347eb5d4310a.zip |
Show subscription request in conversation summary
Diffstat (limited to 'libdino/src/application.vala')
-rw-r--r-- | libdino/src/application.vala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libdino/src/application.vala b/libdino/src/application.vala index 55913a99..f6e651a4 100644 --- a/libdino/src/application.vala +++ b/libdino/src/application.vala @@ -38,6 +38,8 @@ public interface Dino.Application : GLib.Application { ChatInteraction.start(stream_interactor); FileManager.start(stream_interactor, db); + create_actions(); + activate.connect(() => { stream_interactor.connection_manager.log_options = print_xmpp; Idle.add(() => { @@ -93,6 +95,17 @@ public interface Dino.Application : GLib.Application { return (Dino.Application) GLib.Application.get_default(); } + public void create_actions() { + SimpleAction accept_subscription_action = new SimpleAction("accept-subscription", VariantType.INT32); + accept_subscription_action.activate.connect((variant) => { + Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_by_id(variant.get_int32()); + if (conversation == null) return; + stream_interactor.get_module(PresenceManager.IDENTITY).approve_subscription(conversation.account, conversation.counterpart); + stream_interactor.get_module(PresenceManager.IDENTITY).request_subscription(conversation.account, conversation.counterpart); + }); + add_action(accept_subscription_action); + } + protected void add_connection(Account account) { stream_interactor.connect(account); } |