From db57a973534f099af2b150f1a1307d1948553d9f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 19 Mar 2017 12:55:36 +0100 Subject: Add typed identity to manager modules and stream flags --- xmpp-vala/src/module/xep/0054_vcard/module.vala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xmpp-vala/src/module/xep/0054_vcard') 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 IDENTITY = new ModuleIdentity(NS_URI, ID); + public static ModuleIdentity IDENTITY = new ModuleIdentity(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); -- cgit v1.2.3-70-g09d2