Skip to content

Commit

Permalink
Fixed deprecated call
Browse files Browse the repository at this point in the history
  • Loading branch information
cijo7 committed Mar 30, 2017
1 parent 4e898fa commit 3171dca
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -116,7 +117,11 @@ private Message parseOtrChat(String body, Jid from, String id, Conversation conv
}
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();
Expand Down

0 comments on commit 3171dca

Please sign in to comment.