aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-03-31 14:13:12 +0200
committersteckbrief <steckbrief@chefmail.de>2015-03-31 14:13:12 +0200
commit52ed924a1333448505e83204d3d9b248b2356004 (patch)
tree29412905e54da231589a1a553808ee4e9934b7db /src/main/java/eu
parent75c5275f7e9a27019b9517770603ca4c77f1fbd9 (diff)
Changes for emoticon parser reactivated
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java10
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index c4a446e8..fac4cc91 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -120,7 +120,9 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
Pair<String,Boolean> preview = UIHelper.getMessagePreview(activity,message);
mLastMessage.setVisibility(View.VISIBLE);
imagePreview.setVisibility(View.GONE);
- mLastMessage.setText(preview.first);
+ boolean parseEmoticons = Settings.PARSE_EMOTICONS;
+ CharSequence msgText = parseEmoticons ? UIHelper.transformAsciiEmoticons(getContext(), preview.first) : preview.first;
+ mLastMessage.setText(msgText);
if (preview.second) {
if (conversation.isRead()) {
mLastMessage.setTypeface(null, Typeface.ITALIC);
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index c3736f0b..c98dbdd0 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -226,17 +226,17 @@ public class MessageAdapter extends ArrayAdapter<Message> {
final String formattedBody = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,
nick + " ");
if (message.getType() != Message.TYPE_PRIVATE) {
- boolean parseEmoticons = Settings.PARSE_EMOTICONS;
- viewHolder.messageBody.setText(parseEmoticons ? UIHelper
- .transformAsciiEmoticons(getContext(), message.getMergedBody())
- : message.getMergedBody());
+
if (message.hasMeCommand()) {
final Spannable span = new SpannableString(formattedBody);
span.setSpan(new StyleSpan(Typeface.BOLD_ITALIC), 0, nick.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
viewHolder.messageBody.setText(span);
} else {
- viewHolder.messageBody.setText(message.getMergedBody());
+ boolean parseEmoticons = Settings.PARSE_EMOTICONS;
+ viewHolder.messageBody.setText(parseEmoticons ? UIHelper
+ .transformAsciiEmoticons(getContext(), message.getMergedBody())
+ : message.getMergedBody());
}
} else {
String privateMarker;