aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-11-14 16:19:10 +0100
committerfiaxh <git@lightrise.org>2019-11-17 17:53:27 +0100
commita2f63a7789aca9e05e5dfd1a9c2838e31aefe60d (patch)
tree19404ae5541795317117813306ee321793087139 /xmpp-vala/src/module
parentc6bdb1a4bc109256b2a109940c640a8b2ad8f57f (diff)
downloaddino-a2f63a7789aca9e05e5dfd1a9c2838e31aefe60d.tar.gz
dino-a2f63a7789aca9e05e5dfd1a9c2838e31aefe60d.zip
Parse offline member info from MUC presence
Fixes OMEMO only encrypting to new member after restart and private MUC name only updating after restart
Diffstat (limited to 'xmpp-vala/src/module')
-rw-r--r--xmpp-vala/src/module/xep/0045_muc/flag.vala2
-rw-r--r--xmpp-vala/src/module/xep/0045_muc/module.vala6
2 files changed, 6 insertions, 2 deletions
diff --git a/xmpp-vala/src/module/xep/0045_muc/flag.vala b/xmpp-vala/src/module/xep/0045_muc/flag.vala
index 87e0930f..c6c2ef3b 100644
--- a/xmpp-vala/src/module/xep/0045_muc/flag.vala
+++ b/xmpp-vala/src/module/xep/0045_muc/flag.vala
@@ -72,7 +72,7 @@ public class Flag : XmppStreamFlag {
internal void set_real_jid(Jid full_jid, Jid real_jid) { occupant_real_jids[full_jid] = real_jid; }
internal void set_offline_member(Jid muc_jid, Jid real_jid, Affiliation affiliation) {
- set_affiliation(muc_jid.bare_jid, real_jid, affiliation);
+ set_affiliation(muc_jid.bare_jid, real_jid.bare_jid, affiliation);
}
internal void set_affiliation(Jid muc_jid, Jid full_jid, Affiliation affiliation) {
diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala
index db7a299f..85c78266 100644
--- a/xmpp-vala/src/module/xep/0045_muc/module.vala
+++ b/xmpp-vala/src/module/xep/0045_muc/module.vala
@@ -282,8 +282,9 @@ public class Module : XmppStreamModule {
}
}
string? affiliation_str = x_node.get_deep_attribute("item", "affiliation");
+ Affiliation? affiliation = null;
if (affiliation_str != null) {
- Affiliation affiliation = parse_affiliation(affiliation_str);
+ affiliation = parse_affiliation(affiliation_str);
flag.set_affiliation(presence.from.bare_jid, presence.from, affiliation);
received_occupant_affiliation(stream, presence.from, affiliation);
}
@@ -291,6 +292,9 @@ public class Module : XmppStreamModule {
if (jid_ != null) {
Jid? jid = Jid.parse(jid_);
flag.set_real_jid(presence.from, jid);
+ if (affiliation != null) {
+ stream.get_flag(Flag.IDENTITY).set_offline_member(presence.from, jid, affiliation);
+ }
received_occupant_jid(stream, presence.from, jid);
}
string? role_str = x_node.get_deep_attribute("item", "role");