aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2024-09-15 17:54:59 +0200
committerMiquel Lionel <lionel@les-miquelots.net>2024-09-22 14:20:06 +0200
commit50f97ccbf3f672ecd6d37cab3fa8c59ead9d1631 (patch)
tree5ee948c2b5b8931aacf04d578aba9c89bb8af697 /libdino/src/service
parent65404b24424b2c554c611b24e9ddf7e12ce1a9f4 (diff)
downloaddino-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 'libdino/src/service')
-rw-r--r--libdino/src/service/presence_manager.vala12
1 files changed, 12 insertions, 0 deletions
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)