From 28fefad8343c6d0aea2f52333e60b4dd003e811a Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Fri, 21 Nov 2014 20:34:19 +0100 Subject: [PATCH] work around to not confuse irc transport with real conference servers --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index dc895eadb..2f5994c46 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -810,7 +810,12 @@ public class XmppConnection implements Runnable { final List elements = packet.query().getChildren(); final List features = new ArrayList<>(); for (Element element : elements) { - if (element.getName().equals("feature")) { + if (element.getName().equals("identity")) { + if ("irc".equals(element.getAttribute("type"))) { + //add fake feature to not confuse irc and real muc + features.add("siacs:no:muc"); + } + } else if (element.getName().equals("feature")) { features.add(element.getAttribute("var")); } } @@ -1052,7 +1057,7 @@ public class XmppConnection implements Runnable { final List items = new ArrayList<>(); for (Entry> cursor : disco.entrySet()) { final List value = cursor.getValue(); - if (value.contains("http://jabber.org/protocol/muc") && !value.contains("jabber:iq:gateway")) { + if (value.contains("http://jabber.org/protocol/muc") && !value.contains("jabber:iq:gateway") && !value.contains("siacs:no:muc")) { return cursor.getKey(); } }