Skip to content

Commit

Permalink
Fix redirectLink for sharings push notification
Browse files Browse the repository at this point in the history
The flagship app doesn't support links to an external Cozy in a push
notification currently. So, let's send the user to the list of their
sharings for the moment.
  • Loading branch information
nono committed Jan 16, 2025
1 parent 953a478 commit fbd99d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/sharing/invitation.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,14 @@ func (s *Sharing) SendShortcutNotification(inst *instance.Instance, fileDoc *vfs
if sharerName == "" {
sharerName = inst.Translate("Sharing Empty name")
}
if err := s.SendShortcutPush(inst, fileDoc, previewURL, sharerName); err != nil {
if err := s.SendShortcutPush(inst, fileDoc, sharerName); err != nil {
inst.Logger().WithNamespace("sharing").
Warnf("Cannot send push notification: %s", err)
}
return s.SendShortcutMail(inst, fileDoc, previewURL, sharerName)
}

func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc, previewURL, sharerName string) error {
func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc, sharerName string) error {
notifiables, err := oauth.GetNotifiables(inst)
if err != nil {
return err
Expand All @@ -390,7 +390,7 @@ func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc
Title: title,
Message: message,
Data: map[string]interface{}{
"redirectLink": previewURL,
"redirectLink": "drive/#/sharings",
},
}
msg, err := job.NewMessage(&push)
Expand Down

0 comments on commit fbd99d0

Please sign in to comment.