Skip to content

Commit 20a58fd

Browse files
authored
Fix redirectLink for sharings push notification (#4507)
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.
2 parents 953a478 + 057cec8 commit 20a58fd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

model/sharing/invitation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ func (s *Sharing) SendShortcutNotification(inst *instance.Instance, fileDoc *vfs
360360
if sharerName == "" {
361361
sharerName = inst.Translate("Sharing Empty name")
362362
}
363-
if err := s.SendShortcutPush(inst, fileDoc, previewURL, sharerName); err != nil {
363+
if err := s.SendShortcutPush(inst, fileDoc, sharerName); err != nil {
364364
inst.Logger().WithNamespace("sharing").
365365
Warnf("Cannot send push notification: %s", err)
366366
}
367367
return s.SendShortcutMail(inst, fileDoc, previewURL, sharerName)
368368
}
369369

370-
func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc, previewURL, sharerName string) error {
370+
func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc, sharerName string) error {
371371
notifiables, err := oauth.GetNotifiables(inst)
372372
if err != nil {
373373
return err
@@ -390,7 +390,7 @@ func (s *Sharing) SendShortcutPush(inst *instance.Instance, fileDoc *vfs.FileDoc
390390
Title: title,
391391
Message: message,
392392
Data: map[string]interface{}{
393-
"redirectLink": previewURL,
393+
"redirectLink": "drive/#/sharings",
394394
},
395395
}
396396
msg, err := job.NewMessage(&push)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
# echo -ne fred | md5sum
4-
export OC_PASS=570a90bfbf8c7eab5dc5d4e26832d5b1
3+
# echo -ne fred-password | md5sum
4+
export OC_PASS=796ecbcc9e42a074e22b2c9aa03b79c6
55
php occ user:add --password-from-env --display-name="Fred" --group="users" fred

tests/system/tests/webdav_nextcloud.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
host = container.host
2323
port = container.first_mapped_port
2424
user = "fred"
25-
pass = "570a90bfbf8c7eab5dc5d4e26832d5b1"
25+
pass = "796ecbcc9e42a074e22b2c9aa03b79c6"
2626

2727
inst = Instance.create name: "Fred"
2828
auth = { login: user, password: pass, url: "http://#{host}:#{port}/" }

0 commit comments

Comments
 (0)