Fixed deprecated call

This commit is contained in:
cijo-saju 2017-03-28 23:32:35 +05:30
parent 4e898fa4f2
commit 3171dcac8d

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.parser; package eu.siacs.conversations.parser;
import android.os.Build;
import android.text.Html; import android.text.Html;
import android.util.Log; import android.util.Log;
import android.util.Pair; import android.util.Pair;
@ -116,7 +117,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
if (clientMightSendHtml(conversation.getAccount(), from)) { if (clientMightSendHtml(conversation.getAccount(), from)) {
Log.d(Config.LOGTAG,conversation.getAccount().getJid().toBareJid()+": received OTR message from bad behaving client. escaping HTML…"); 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(); final OtrService otrService = conversation.getAccount().getOtrService();