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,8 +117,12 @@ 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…");
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(); body = Html.fromHtml(body).toString();
} }
}
final OtrService otrService = conversation.getAccount().getOtrService(); final OtrService otrService = conversation.getAccount().getOtrService();
Message finishedMessage = new Message(conversation, body, Message.ENCRYPTION_OTR, Message.STATUS_RECEIVED); Message finishedMessage = new Message(conversation, body, Message.ENCRYPTION_OTR, Message.STATUS_RECEIVED);