Commit da8f7b757db57f104cfdb7326b3d23b4739eae3f

Authored by OpenWapp Developer
1 parent 3290d10a04

Improving notification report.

Showing 2 changed files with 16 additions and 11 deletions

app/scripts/localisations/translation.js View file @ da8f7b7
... ... @@ -159,7 +159,7 @@
159 159 notificationGroupPictureRemoved: '{{who}} eliminó la foto del grupo',
160 160 notificationGroupPictureRemovedByYou: 'Eliminaste la foto del grupo',
161 161 notificationReportTitle: 'Tienes {{count}} mensajes sin leer.',
162   - notificationReportBody: '{{names}}',
  162 + notificationReportBody: 'De {{count}} conversaciones.',
163 163 inAppNotification: '{{title}}: {{body}}',
164 164 wakeUpTime: 'Comprobar nuevos mensajes…',
165 165 wakeUpDescription: 'Periodos más cortos consumen más batería.',
... ... @@ -337,7 +337,7 @@
337 337 notificationGroupPictureRemoved: '{{who}} removed the group picture',
338 338 notificationGroupPictureRemovedByYou: 'You removed the group picture',
339 339 notificationReportTitle: 'You have {{count}} new messages.',
340   - notificationReportBody: '{{names}}',
  340 + notificationReportBody: 'From {{count}} conversations.',
341 341 inAppNotification: '{{title}}: {{body}}',
342 342 wakeUpTime: 'Check for messages…',
343 343 wakeUpDescription: 'Time period to check for new messages: shorter ' +
... ... @@ -514,7 +514,7 @@
514 514 notificationGroupPictureRemoved: '{{who}} removido a foto de grupo',
515 515 notificationGroupPictureRemovedByYou: 'Você removido a foto de grupo',
516 516 notificationReportTitle: 'Você tem {{count}} mensagens não lidas.',
517   - notificationReportBody: '{{names}}',
  517 + notificationReportBody: 'A partir de {{count}} conversas.',
518 518 inAppNotification: '{{title}}: {{body}}',
519 519 wakeUpTime: 'Verificar as mensagens recebidas…',
520 520 wakeUpDescription: 'Menor tempo de levar a um maior consumo de bateria',
... ... @@ -692,7 +692,7 @@
692 692 notificationGroupPictureRemoved: '{{who}} removido a foto de grupo',
693 693 notificationGroupPictureRemovedByYou: 'Você removido a foto de grupo',
694 694 notificationReportTitle: 'Você tem {{count}} mensagens não lidas.',
695   - notificationReportBody: '{{names}}',
  695 + notificationReportBody: 'A partir de {{count}} conversas.',
696 696 inAppNotification: '{{title}}: {{body}}',
697 697 wakeUpTime: 'Verificar as mensagens recebidas…',
698 698 wakeUpDescription: 'Menor tempo de levar a um maior consumo de bateria',
app/scripts/utils/notifications.js View file @ da8f7b7
... ... @@ -80,13 +80,18 @@
80 80 var titleMsg = l10n[titleId];
81 81 var bodyMsg = l10n[bodyId];
82 82  
83   - notification.title =
84   - interpolate(titleMsg, { count: pendingNotifications });
  83 + var notificationsByConversations = {};
  84 + this._queue.forEach(function (notification) {
  85 + notificationsByConversations[notification.conversationId] = true;
  86 + });
85 87  
86   - notification.body =
87   - interpolate(bodyMsg, { names: this._queue.map(function (item) {
88   - return item.title;
89   - }) });
  88 + notification.title = interpolate(titleMsg, {
  89 + count: pendingNotifications
  90 + });
  91 +
  92 + notification.body = interpolate(bodyMsg, {
  93 + count: Object.keys(notificationsByConversations).length
  94 + });
90 95 }
91 96  
92 97 this._queue = [];