aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-02 21:07:14 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-02 21:07:14 +0200
commitf6df6c36040882ec01eb6a21ad24d15b8232875d (patch)
treed4784495a58bdefdab66f1df68da3dae14b1d2c6 /src/main/java/de/pixart/messenger/parser
parent6dac604f4065429b7d9390eed01bde94844268a9 (diff)
check if jid was valid before parsing muc status or event msgs
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index c72af97aa..3e6483650 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -407,7 +407,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
return;
}
boolean isProperlyAddressed = (to != null) && (!to.isBareJid() || account.countPresences() == 0);
- boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
+ boolean isMucStatusMessage = InvalidJid.hasValidFrom(packet) && from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
boolean selfAddressed;
if (packet.fromAccount(account)) {
status = Message.STATUS_SEND;
@@ -759,7 +759,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
}
}
- if (conversation != null && mucUserElement != null && from.isBareJid()) {
+ if (conversation != null && mucUserElement != null && InvalidJid.hasValidFrom(packet) && from.isBareJid()) {
for (Element child : mucUserElement.getChildren()) {
if ("status".equals(child.getName())) {
try {
@@ -861,12 +861,12 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
Element event = original.findChild("event", "http://jabber.org/protocol/pubsub#event");
- if (event != null) {
+ if (event != null && InvalidJid.hasValidFrom(original)) {
parseEvent(event, original.getFrom(), account);
}
final String nick = packet.findChildContent("nick", Namespace.NICK);
- if (nick != null) {
+ if (nick != null && InvalidJid.hasValidFrom(original)) {
Contact contact = account.getRoster().getContact(from);
if (contact.setPresenceName(nick)) {
mXmppConnectionService.getAvatarService().clear(contact);