From 50f97ccbf3f672ecd6d37cab3fa8c59ead9d1631 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Sun, 15 Sep 2024 17:54:59 +0200 Subject: Enable setting your own presence - added 1 new icon for xa (extended away/unavailable) --- libdino/src/service/presence_manager.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libdino') diff --git a/libdino/src/service/presence_manager.vala b/libdino/src/service/presence_manager.vala index a9dc83aa..65993f88 100644 --- a/libdino/src/service/presence_manager.vala +++ b/libdino/src/service/presence_manager.vala @@ -77,6 +77,18 @@ public class PresenceManager : StreamInteractionModule, Object { if (stream != null) stream.get_module(Xmpp.Presence.Module.IDENTITY).cancel_subscription(stream, jid.bare_jid); } + public void send_presence(string? pres_str){ + foreach(Account account in stream_interactor.get_accounts()) { + XmppStream stream = stream_interactor.get_stream(account); + Xmpp.Presence.Stanza presence = new Xmpp.Presence.Stanza(); + if (pres_str != null) presence.show = pres_str; + if (stream != null) { + stream.get_module(Xmpp.Presence.Module.IDENTITY).send_presence(stream, presence); + } + } + } + + private void on_account_added(Account account) { stream_interactor.module_manager.get_module(account, Presence.Module.IDENTITY).received_available_show.connect((stream, jid, show) => on_received_available_show(account, jid, show) -- cgit v1.2.3-70-g09d2