From f4066315121ef67b33f39ed67bc2cb1832ae3445 Mon Sep 17 00:00:00 2001
From: Daniel Gultsch <daniel@gultsch.de>
Date: Sat, 2 Mar 2019 08:36:36 +0100
Subject: [PATCH] double check that muc message is ours if true jid is known

---
 .../eu/siacs/conversations/parser/MessageParser.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 481609ce3..0bad7db61 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -503,8 +503,13 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
                 } else {
                     trueCounterpart = fallback;
                 }
-                if (trueCounterpart != null && trueCounterpart.asBareJid().equals(account.getJid().asBareJid())) {
-                    status = isTypeGroupChat ? Message.STATUS_SEND_RECEIVED : Message.STATUS_SEND;
+                if (trueCounterpart != null) {
+                    if (trueCounterpart.asBareJid().equals(account.getJid().asBareJid())) {
+                        status = isTypeGroupChat ? Message.STATUS_SEND_RECEIVED : Message.STATUS_SEND;
+                    } else {
+                        status = Message.STATUS_RECEIVED;
+                        message.setCarbon(false);
+                    }
                 }
                 message.setStatus(status);
                 message.setTrueCounterpart(trueCounterpart);