aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian S <kriztan@users.noreply.github.com>2016-01-13 17:50:25 +0100
committerChristian S <kriztan@users.noreply.github.com>2016-01-13 17:50:25 +0100
commit51a288b26d68aa9b54aefc45c76f54e77744d038 (patch)
tree08713506c27af1676fd0a71bf54c14980b37b6bd /src
parent4c2dc7082855581d875c51d97650c7b4a435abe5 (diff)
parent12fd5c46ef96b78f1ce6056f743b5005e22a66c8 (diff)
Merge pull request #63 from siacs/master
copy commits
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index b01ad4441..f4498adb8 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -232,9 +232,9 @@ public class NotificationService {
final String name = conversation.getName();
if (Config.HIDE_MESSAGE_TEXT_IN_NOTIFICATION) {
int count = messages.size();
- style.addLine(Html.fromHtml("<b>"+name+"</b> "+mXmppConnectionService.getResources().getQuantityString(R.plurals.x_messages,count,count)));
+ style.addLine(Html.fromHtml("<b>"+name+"</b>: "+mXmppConnectionService.getResources().getQuantityString(R.plurals.x_messages,count,count)));
} else {
- style.addLine(Html.fromHtml("<b>" + name + "</b> "
+ style.addLine(Html.fromHtml("<b>" + name + "</b>: "
+ UIHelper.getMessagePreview(mXmppConnectionService, messages.get(0)).first));
}
names.append(name);
@@ -339,13 +339,18 @@ public class NotificationService {
final Message last = messages.get(messages.size() - 1);
final NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();
style.setBigContentTitle(conversation.getName());
+
for(Message message : messages) {
- style.addLine(Html.fromHtml("<b>"+UIHelper.getMessageDisplayName(message)+"</b> "+UIHelper.getMessagePreview(mXmppConnectionService,message).first));
+ if (message.hasMeCommand()) {
+ style.addLine(UIHelper.getMessagePreview(mXmppConnectionService,message).first);
+ } else {
+ style.addLine(Html.fromHtml("<b>" + UIHelper.getMessageDisplayName(message) + "</b>: " + UIHelper.getMessagePreview(mXmppConnectionService, message).first));
+ }
}
- builder.setContentText(UIHelper.getMessageDisplayName(first)+ ": " +UIHelper.getMessagePreview(mXmppConnectionService, messages.get(0)).first);
+ builder.setContentText((first.hasMeCommand() ? "" :UIHelper.getMessageDisplayName(first)+ ": ") +UIHelper.getMessagePreview(mXmppConnectionService, first).first);
builder.setStyle(style);
if (notify) {
- builder.setTicker(UIHelper.getMessageDisplayName(last) + ": " + UIHelper.getMessagePreview(mXmppConnectionService,last).first);
+ builder.setTicker((last.hasMeCommand() ? "" : UIHelper.getMessageDisplayName(last) + ": ") + UIHelper.getMessagePreview(mXmppConnectionService,last).first);
}
}