Commit 941cfa58 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Properly display the messages' count per room inside the notification on O

parent eb3d41bb
...@@ -242,14 +242,17 @@ object PushManager { ...@@ -242,14 +242,17 @@ object PushManager {
val pushMessageList = hostToPushMessageList.get(host) val pushMessageList = hostToPushMessageList.get(host)
pushMessageList?.let { pushMessageList?.let {
val messageCount = pushMessageList.size val count = pushMessageList.filter {
builder.setContentTitle(getTitle(messageCount, title)) it.title == title
}.size
builder.setContentTitle(getTitle(count, title))
val inbox = Notification.InboxStyle() val inbox = Notification.InboxStyle()
.setBigContentTitle(getTitle(messageCount, title)) .setBigContentTitle(getTitle(count, title))
for (push in pushMessageList) { for (push in pushMessageList) {
inbox.addLine("AAAA") inbox.addLine(push.message)
} }
builder.setStyle(inbox) builder.setStyle(inbox)
...@@ -348,8 +351,12 @@ object PushManager { ...@@ -348,8 +351,12 @@ object PushManager {
val userMessages = pushMessageList.filter { val userMessages = pushMessageList.filter {
it.notificationId == lastPushMessage.notificationId } it.notificationId == lastPushMessage.notificationId }
builder.setContentTitle(getTitle(messageCount, title)) val count = pushMessageList.filter {
inbox.setBigContentTitle(getTitle(messageCount, title)) it.title == title
}.size
builder.setContentTitle(getTitle(count, title))
inbox.setBigContentTitle(getTitle(count, title))
for (push in userMessages) { for (push in userMessages) {
inbox.addLine(push.message) inbox.addLine(push.message)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment