aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-12-17 14:30:00 +0100
committerDaniel Gultsch <daniel@gultsch.de>2015-12-17 14:30:00 +0100
commite10a0b0c4c052adc803a8843a597afe9a13016ac (patch)
treeead4b60b8c168286af9d2843cfd2708679292d35 /src
parent43dd681239ea5a287f5761597de5dcdc4daed3de (diff)
let message parser not artifically fail on messages with no to attribute
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index d8190b70..23a23b2c 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -304,17 +304,17 @@ public class MessageParser extends AbstractParser implements
final Jid from = packet.getFrom();
final String remoteMsgId = packet.getId();
- if (from == null || to == null) {
- Log.d(Config.LOGTAG,"no to or from in: "+packet.toString());
+ if (from == null) {
+ Log.d(Config.LOGTAG,"no from in: "+packet.toString());
return;
}
boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT;
- boolean isProperlyAddressed = !to.isBareJid() || account.countPresences() == 1;
+ boolean isProperlyAddressed = (to != null ) && (!to.isBareJid() || account.countPresences() == 1);
boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
if (packet.fromAccount(account)) {
status = Message.STATUS_SEND;
- counterpart = to;
+ counterpart = to != null ? to : account.getJid();
} else {
status = Message.STATUS_RECEIVED;
counterpart = from;