aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2018-11-10 08:05:14 -0600
committerMarvin W <git@larma.de>2018-11-10 08:05:14 -0600
commitdfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed (patch)
treed3c1ae4251844239eb46e57c8eacf03466aed608 /xmpp-vala
parent559bbc5ca3ad5d44ea949788005a29fe9d86a232 (diff)
parent65a12021bc7abbf5ddea068ffe9b4715cfc34f0b (diff)
downloaddino-dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed.tar.gz
dino-dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed.zip
Merge PR #413 "Improvements to the OMEMO plugin"
Diffstat (limited to 'xmpp-vala')
-rw-r--r--xmpp-vala/src/module/presence/flag.vala2
-rw-r--r--xmpp-vala/src/module/presence/module.vala4
-rw-r--r--xmpp-vala/src/module/roster/module.vala5
3 files changed, 10 insertions, 1 deletions
diff --git a/xmpp-vala/src/module/presence/flag.vala b/xmpp-vala/src/module/presence/flag.vala
index bb3562a4..77bc0b5f 100644
--- a/xmpp-vala/src/module/presence/flag.vala
+++ b/xmpp-vala/src/module/presence/flag.vala
@@ -57,4 +57,4 @@ public class Flag : XmppStreamFlag {
}
}
-} \ No newline at end of file
+}
diff --git a/xmpp-vala/src/module/presence/module.vala b/xmpp-vala/src/module/presence/module.vala
index 12b40245..4a9a72a3 100644
--- a/xmpp-vala/src/module/presence/module.vala
+++ b/xmpp-vala/src/module/presence/module.vala
@@ -1,3 +1,5 @@
+using Gee;
+
namespace Xmpp.Presence {
private const string NS_URI = "jabber:client";
@@ -87,6 +89,8 @@ namespace Xmpp.Presence {
stream.get_flag(Flag.IDENTITY).remove_presence(presence.from);
received_unsubscription(stream, presence.from);
break;
+ case Presence.Stanza.TYPE_UNSUBSCRIBED:
+ break;
}
}
diff --git a/xmpp-vala/src/module/roster/module.vala b/xmpp-vala/src/module/roster/module.vala
index 5b15a43a..2d36211d 100644
--- a/xmpp-vala/src/module/roster/module.vala
+++ b/xmpp-vala/src/module/roster/module.vala
@@ -11,6 +11,7 @@ public class Module : XmppStreamModule, Iq.Handler {
public signal void pre_get_roster(XmppStream stream, Iq.Stanza iq);
public signal void item_removed(XmppStream stream, Item item, Iq.Stanza iq);
public signal void item_updated(XmppStream stream, Item item, Iq.Stanza iq);
+ public signal void mutual_subscription(XmppStream stream, Jid jid);
public bool interested_resource = true;
@@ -55,8 +56,12 @@ public class Module : XmppStreamModule, Iq.Handler {
item_removed(stream, item, iq);
break;
default:
+ bool is_new = false;
+ Item old = flag.get_item(item.jid);
+ is_new = item.subscription == Item.SUBSCRIPTION_BOTH && (old == null || old.subscription == Item.SUBSCRIPTION_BOTH);
flag.roster_items[item.jid] = item;
item_updated(stream, item, iq);
+ if(is_new) mutual_subscription(stream, item.jid);
break;
}
}