aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0054_vcard/module.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0054_vcard/module.vala')
-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);