made emoticon parsing enableable - default false
This commit is contained in:
parent
c1453db5df
commit
1f378bffc8
|
@ -16,6 +16,8 @@ public final class Config {
|
||||||
public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP;
|
public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP;
|
||||||
|
|
||||||
public static final int MESSAGE_MERGE_WINDOW = 20;
|
public static final int MESSAGE_MERGE_WINDOW = 20;
|
||||||
|
|
||||||
|
public static final boolean PARSE_EMOTICONS = false;
|
||||||
|
|
||||||
private Config() {
|
private Config() {
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package eu.siacs.conversations.ui.adapter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
import eu.siacs.conversations.entities.Message;
|
import eu.siacs.conversations.entities.Message;
|
||||||
|
@ -63,7 +64,10 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
||||||
|| latestMessage.getType() == Message.TYPE_PRIVATE) {
|
|| latestMessage.getType() == Message.TYPE_PRIVATE) {
|
||||||
if ((latestMessage.getEncryption() != Message.ENCRYPTION_PGP)
|
if ((latestMessage.getEncryption() != Message.ENCRYPTION_PGP)
|
||||||
&& (latestMessage.getEncryption() != Message.ENCRYPTION_DECRYPTION_FAILED)) {
|
&& (latestMessage.getEncryption() != Message.ENCRYPTION_DECRYPTION_FAILED)) {
|
||||||
convLastMsg.setText(UIHelper.transformAsciiEmoticons(conv.getLatestMessage().getBody()));
|
String body = Config.PARSE_EMOTICONS ? UIHelper
|
||||||
|
.transformAsciiEmoticons(latestMessage.getBody())
|
||||||
|
: latestMessage.getBody();
|
||||||
|
convLastMsg.setText(body);
|
||||||
} else {
|
} else {
|
||||||
convLastMsg.setText(activity
|
convLastMsg.setText(activity
|
||||||
.getText(R.string.encrypted_message_received));
|
.getText(R.string.encrypted_message_received));
|
||||||
|
|
|
@ -3,6 +3,7 @@ package eu.siacs.conversations.ui.adapter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.entities.Contact;
|
import eu.siacs.conversations.entities.Contact;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
|
@ -215,7 +216,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
viewHolder.messageBody.setVisibility(View.VISIBLE);
|
viewHolder.messageBody.setVisibility(View.VISIBLE);
|
||||||
if (message.getBody() != null) {
|
if (message.getBody() != null) {
|
||||||
if (message.getType() != Message.TYPE_PRIVATE) {
|
if (message.getType() != Message.TYPE_PRIVATE) {
|
||||||
viewHolder.messageBody.setText(UIHelper.transformAsciiEmoticons(message.getMergedBody()));
|
String body = Config.PARSE_EMOTICONS ? UIHelper
|
||||||
|
.transformAsciiEmoticons(message.getMergedBody())
|
||||||
|
: message.getMergedBody();
|
||||||
|
viewHolder.messageBody.setText(body);
|
||||||
} else {
|
} else {
|
||||||
String privateMarker;
|
String privateMarker;
|
||||||
if (message.getStatus() <= Message.STATUS_RECEIVED) {
|
if (message.getStatus() <= Message.STATUS_RECEIVED) {
|
||||||
|
|
Loading…
Reference in New Issue