From bb22bc712f537294ea4b444999e454ab0b3504f6 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 5 Apr 2017 20:24:33 +0200 Subject: Fixed deprecated call --- src/main/java/de/pixart/messenger/parser/MessageParser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main') 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(); -- cgit v1.2.3