From 3171dcac8d34b527f36188f22f59e4336c7afb68 Mon Sep 17 00:00:00 2001 From: cijo-saju Date: Tue, 28 Mar 2017 23:32:35 +0530 Subject: [PATCH] Fixed deprecated call --- .../java/eu/siacs/conversations/parser/MessageParser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index ca173c363..7d6e79018 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -1,5 +1,6 @@ package eu.siacs.conversations.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();