aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-04-05 20:24:33 +0200
committerChristian Schneppe <christian@pix-art.de>2017-04-05 22:21:41 +0200
commitbb22bc712f537294ea4b444999e454ab0b3504f6 (patch)
tree9aa7a1808be2382ec43e9da766dda1830580d747 /src/main/java/de/pixart/messenger/parser
parent36f01514794bf39ce16292545f9027ff73915f05 (diff)
Fixed deprecated call
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-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();