feat(BRIDGE-37): Remote notification support

This commit is contained in:
Atanas Janeshliev
2024-08-29 13:31:37 +02:00
parent ed1b65731a
commit f04350c046
43 changed files with 2350 additions and 1168 deletions

View File

@ -18,6 +18,7 @@
package grpc
import (
"github.com/ProtonMail/proton-bridge/v3/internal/events"
"github.com/ProtonMail/proton-bridge/v3/internal/kb"
"github.com/bradenaw/juniper/xslices"
)
@ -249,6 +250,16 @@ func NewAllUsersLoadedEvent() *StreamEvent {
return appEvent(&AppEvent{Event: &AppEvent_AllUsersLoaded{AllUsersLoaded: &AllUsersLoadedEvent{}}})
}
func NewUserNotificationEvent(event events.UserNotification) *StreamEvent {
return appEvent(&AppEvent{Event: &AppEvent_UserNotification{
UserNotification: &UserNotificationEvent{
UserID: event.UserID,
Title: event.Title,
Subtitle: event.Subtitle,
Body: event.Body,
}}})
}
// Event category factory functions.
func appEvent(appEvent *AppEvent) *StreamEvent {