From 8027b3be248a175c68573c65824319a6747ff89a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 22 Jul 2022 10:39:18 +0200 Subject: [PATCH] parse pep events only from bare jid --- .../eu/siacs/conversations/parser/MessageParser.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index f45b1e89b..86799bd11 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -196,8 +196,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } private void parseEvent(final Element event, final Jid from, final Account account) { - Element items = event.findChild("items"); - String node = items == null ? null : items.getAttribute("node"); + final Element items = event.findChild("items"); + final String node = items == null ? null : items.getAttribute("node"); if ("urn:xmpp:avatar:metadata".equals(node)) { Avatar avatar = Avatar.parseMetadata(items); if (avatar != null) { @@ -1000,7 +1000,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece } final Element event = original.findChild("event", "http://jabber.org/protocol/pubsub#event"); - if (event != null && InvalidJid.hasValidFrom(original)) { + if (event != null && InvalidJid.hasValidFrom(original) && original.getFrom().isBareJid()) { if (event.hasChild("items")) { parseEvent(event, original.getFrom(), account); } else if (event.hasChild("delete")) { @@ -1012,6 +1012,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece final String nick = packet.findChildContent("nick", Namespace.NICK); if (nick != null && InvalidJid.hasValidFrom(original)) { + if (mXmppConnectionService.isMuc(account, from)) { + return; + } final Contact contact = account.getRoster().getContact(from); if (contact.setPresenceName(nick)) { mXmppConnectionService.syncRoster(account);