aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index f63d17236..90bff0e1a 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -1,5 +1,6 @@
package de.pixart.messenger.parser;
+import android.os.Build;
import android.text.Html;
import android.util.Log;
import android.util.Pair;
@@ -116,7 +117,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
if (clientMightSendHtml(conversation.getAccount(), from)) {
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid() + ": received OTR message from bad behaving client. escaping HTML…");
- body = Html.fromHtml(body).toString();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ body = Html.fromHtml(body, Html.FROM_HTML_MODE_LEGACY).toString();
+ } else {
+ body = Html.fromHtml(body).toString();
+ }
}
final OtrService otrService = conversation.getAccount().getOtrService();