aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0054_vcard
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-19 12:55:36 +0100
committerfiaxh <git@mx.ax.lt>2017-03-20 22:28:27 +0100
commitdb57a973534f099af2b150f1a1307d1948553d9f (patch)
tree238ae1d4e53412a33e3febd07318dfd38b0eb2f8 /xmpp-vala/src/module/xep/0054_vcard
parent233f2b35d033cd20d1ac648bf2d723bcb7a918fc (diff)
downloaddino-db57a973534f099af2b150f1a1307d1948553d9f.tar.gz
dino-db57a973534f099af2b150f1a1307d1948553d9f.zip
Add typed identity to manager modules and stream flags
Diffstat (limited to 'xmpp-vala/src/module/xep/0054_vcard')
-rw-r--r--xmpp-vala/src/module/xep/0054_vcard/module.vala9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmpp-vala/src/module/xep/0054_vcard/module.vala b/xmpp-vala/src/module/xep/0054_vcard/module.vala
index b4c6910b..040e0646 100644
--- a/xmpp-vala/src/module/xep/0054_vcard/module.vala
+++ b/xmpp-vala/src/module/xep/0054_vcard/module.vala
@@ -5,8 +5,7 @@ private const string NS_URI = "vcard-temp";
private const string NS_URI_UPDATE = NS_URI + ":x:update";
public class Module : XmppStreamModule {
- public const string ID = "0027_current_pgp_usage";
- public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, ID);
+ public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "0027_current_pgp_usage");
public signal void received_avatar(XmppStream stream, string jid, string id);
@@ -31,7 +30,7 @@ public class Module : XmppStreamModule {
}
public override string get_ns() { return NS_URI; }
- public override string get_id() { return ID; }
+ public override string get_id() { return IDENTITY.id; }
private void on_received_presence(XmppStream stream, Presence.Stanza presence) {
StanzaNode? update_node = presence.stanza.get_subnode("x", NS_URI_UPDATE);
@@ -41,14 +40,14 @@ public class Module : XmppStreamModule {
string? sha1 = photo_node.get_string_content();
if (sha1 == null) return;
if (storage.has_image(sha1)) {
- if (Muc.Flag.get_flag(stream).is_occupant(presence.from)) {
+ if (stream.get_flag(Muc.Flag.IDENTITY).is_occupant(presence.from)) {
received_avatar(stream, presence.from, sha1);
} else {
received_avatar(stream, get_bare_jid(presence.from), sha1);
}
} else {
Iq.Stanza iq = new Iq.Stanza.get(new StanzaNode.build("vCard", NS_URI).add_self_xmlns());
- if (Muc.Flag.get_flag(stream).is_occupant(presence.from)) {
+ if (stream.get_flag(Muc.Flag.IDENTITY).is_occupant(presence.from)) {
iq.to = presence.from;
} else {
iq.to = get_bare_jid(presence.from);