Notification improvements
- Remove on read, on focus, and on exit. - Show multi-message notifications like '5 new messages'.
This commit is contained in:
parent
f693c00778
commit
3bf8a8966a
7 changed files with 104 additions and 23 deletions
|
@ -1642,14 +1642,27 @@
|
|||
'private'
|
||||
).then(sender =>
|
||||
sender.getNotificationIcon().then(iconUrl => {
|
||||
console.log('adding notification');
|
||||
const messageJSON = message.toJSON();
|
||||
const messageSentAt = messageJSON.sent_at;
|
||||
const messageId = message.id;
|
||||
const isExpiringMessage = Signal.Types.Message.hasExpiration(
|
||||
messageJSON
|
||||
);
|
||||
|
||||
console.log('Add notification', {
|
||||
conversationId: this.idForLogging(),
|
||||
isExpiringMessage,
|
||||
messageSentAt,
|
||||
});
|
||||
Whisper.Notifications.add({
|
||||
title: sender.getTitle(),
|
||||
message: message.getNotificationText(),
|
||||
conversationId,
|
||||
iconUrl,
|
||||
imageUrl: message.getImageUrl(),
|
||||
conversationId,
|
||||
messageId: message.id,
|
||||
isExpiringMessage,
|
||||
message: message.getNotificationText(),
|
||||
messageId,
|
||||
messageSentAt,
|
||||
title: sender.getTitle(),
|
||||
});
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue