diff options
author | Miquel Lionel <lionel@les-miquelots.net> | 2024-09-15 17:54:59 +0200 |
---|---|---|
committer | Miquel Lionel <lionel@les-miquelots.net> | 2024-09-22 14:20:06 +0200 |
commit | 50f97ccbf3f672ecd6d37cab3fa8c59ead9d1631 (patch) | |
tree | 5ee948c2b5b8931aacf04d578aba9c89bb8af697 /main/src/ui/application.vala | |
parent | 65404b24424b2c554c611b24e9ddf7e12ce1a9f4 (diff) | |
download | dino-set-presence.tar.gz dino-set-presence.zip |
Enable setting your own presenceset-presence
- added 1 new icon for xa (extended away/unavailable)
Diffstat (limited to 'main/src/ui/application.vala')
-rw-r--r-- | main/src/ui/application.vala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 706a61e6..ba8d411e 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -231,6 +231,35 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { call_state.reject(); }); add_action(deny_call_action); + + SimpleAction p_online_action = new SimpleAction("presence_online", null); + p_online_action.activate.connect( () => { + stream_interactor.get_module(PresenceManager.IDENTITY).send_presence(Xmpp.Presence.Stanza.SHOW_ONLINE); + window.refresh_presence_button(Xmpp.Presence.Stanza.SHOW_ONLINE); + }); + add_action(p_online_action); + + SimpleAction p_dnd_action = new SimpleAction("presence_dnd", null); + p_dnd_action.activate.connect( () => { + stream_interactor.get_module(PresenceManager.IDENTITY).send_presence(Xmpp.Presence.Stanza.SHOW_DND); + window.refresh_presence_button(Xmpp.Presence.Stanza.SHOW_DND); + }); + add_action(p_dnd_action); + + SimpleAction p_away_action = new SimpleAction("presence_away", null); + p_away_action.activate.connect( () => { + stream_interactor.get_module(PresenceManager.IDENTITY).send_presence(Xmpp.Presence.Stanza.SHOW_AWAY); + window.refresh_presence_button(Xmpp.Presence.Stanza.SHOW_AWAY); + }); + add_action(p_away_action); + + SimpleAction p_xaway_action = new SimpleAction("presence_xaway", null); + p_xaway_action.activate.connect( () => { + stream_interactor.get_module(PresenceManager.IDENTITY).send_presence(Xmpp.Presence.Stanza.SHOW_XA); + window.refresh_presence_button(Xmpp.Presence.Stanza.SHOW_XA); + }); + add_action(p_xaway_action); + } private void show_preferences_window() { |