aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-12 21:54:57 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-12 21:54:57 +0200
commit12f098230da69a283cde3a51f6c253200e0eb0cf (patch)
treef9ad7a3b614c62e91e8aecc2235532e7c2cacddb /src/main
parent335fa6282764760c988cfb1df23fe62e7df26a03 (diff)
fix OTR
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index 8dad92356..33ef59ef1 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -334,6 +334,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
final MessagePacket packet;
Long timestamp = null;
+ final boolean isForwarded;
boolean isCarbon = false;
String serverMsgId = null;
final Element fin = original.findChild("fin", Namespace.MAM_LEGACY);
@@ -351,6 +352,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
timestamp = f.second;
packet = f.first;
+ isForwarded = true;
serverMsgId = result.getAttribute("id");
query.incrementMessageCount();
} else if (query != null) {
@@ -366,8 +368,10 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
timestamp = f != null ? f.second : null;
isCarbon = f != null;
+ isForwarded = isCarbon;
} else {
packet = original;
+ isForwarded = false;
}
if (timestamp == null) {
@@ -404,6 +408,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
Log.e(Config.LOGTAG, account.getJid().asBareJid() + ": received groupchat (" + from + ") message on regular MAM request. skipping");
return;
}
+ boolean isProperlyAddressed = (to != null) && (!to.isBareJid() || account.countPresences() == 0);
boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status");
boolean selfAddressed;
if (packet.fromAccount(account)) {