From fbd99d049b8c33b640c05ac20a5ae01bfec2acfb Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Thu, 16 Jan 2025 18:23:23 +0100 Subject: [PATCH] Fix redirectLink for sharings push notification 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. --- model/sharing/invitation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/sharing/invitation.go b/model/sharing/invitation.go index 3b68da3894c..2894fa7b235 100644 --- a/model/sharing/invitation.go +++ b/model/sharing/invitation.go @@ -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 @@ -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)