mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Notification improvements
- Remove on read, on focus, and on exit. - Show multi-message notifications like '5 new messages'.
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user