diff options
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r-- | xmpp-vala/src/module/util.vala | 9 | ||||
-rw-r--r-- | xmpp-vala/src/module/xep/0045_muc/module.vala | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/util.vala b/xmpp-vala/src/module/util.vala index 849aeeec..cb11418c 100644 --- a/xmpp-vala/src/module/util.vala +++ b/xmpp-vala/src/module/util.vala @@ -20,9 +20,14 @@ public abstract class StanzaListener<T> : OrderedListener { public class StanzaListenerHolder<T> : ListenerHolder { public async void run(XmppStream stream, T stanza) { - foreach (OrderedListener ol in listeners) { + + // listeners can change e.g. when switching to another stream + ArrayList<OrderedListener> listeners_copy = new ArrayList<OrderedListener>(); + listeners_copy.add_all(listeners); + + foreach (OrderedListener ol in listeners_copy) { StanzaListener<T> l = ol as StanzaListener<T>; - bool stop = yield l.run(stream, stanza); + bool stop = yield l.run(stream, stanza); if (stop) break; } } diff --git a/xmpp-vala/src/module/xep/0045_muc/module.vala b/xmpp-vala/src/module/xep/0045_muc/module.vala index f0ae0ed6..b0a22d6b 100644 --- a/xmpp-vala/src/module/xep/0045_muc/module.vala +++ b/xmpp-vala/src/module/xep/0045_muc/module.vala @@ -173,7 +173,7 @@ public class Module : XmppStreamModule { } public override void attach(XmppStream stream) { - stream.add_flag(new Muc.Flag()); + stream.add_flag(new Flag()); stream.get_module(MessageModule.IDENTITY).received_message.connect(on_received_message); stream.get_module(Presence.Module.IDENTITY).received_presence.connect(check_for_enter_error); stream.get_module(Presence.Module.IDENTITY).received_available.connect(on_received_available); @@ -368,7 +368,7 @@ public class Module : XmppStreamModule { Jid? jid_ = Jid.parse(item.get_attribute("jid")); string? affiliation_ = item.get_attribute("affiliation"); if (jid_ != null && affiliation_ != null) { - stream.get_flag(Muc.Flag.IDENTITY).set_offline_member(iq.from, jid_, parse_affiliation(affiliation_)); + stream.get_flag(Flag.IDENTITY).set_offline_member(iq.from, jid_, parse_affiliation(affiliation_)); ret_jids.add(jid_); } } |