diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 2f5994c4..fb151427 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -848,11 +848,9 @@ public class XmppConnection implements Runnable { List<Element> elements = packet.query().getChildren(); for (Element element : elements) { if (element.getName().equals("item")) { - final String jid = element.getAttribute("jid"); - try { - sendServiceDiscoveryInfo(Jid.fromString(jid).toDomainJid()); - } catch (final InvalidJidException ignored) { - // TODO: Handle the case where an external JID is technically invalid? + final Jid jid = element.getAttributeAsJid("jid"); + if (jid != null && !jid.equals(account.getServer())) { + sendServiceDiscoveryInfo(jid); } } } |