Skip to content

Commit

Permalink
Merge pull request #36393 from owncloud/fix-36386
Browse files Browse the repository at this point in the history
let resharer to send an e-mail for public link
  • Loading branch information
phil-davis authored Nov 11, 2019
2 parents 1c0a659 + 7a304fe commit 5503eb7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/36393
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: allow re-sharer to send an e-mail for public link

Sending an e-mail when creating public links from received shares was impossible. This problem fixed.

https://github.com/owncloud/core/issues/36386
https://github.com/owncloud/core/pull/36393
2 changes: 1 addition & 1 deletion lib/private/Share/MailNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function sendLinkShareMail($sender, $recipients, $link, $personalNote = n
$token = \array_pop($linkParts);
try {
$share = $this->shareManager->getShareByToken($token);
if ($share->getShareOwner() !== $currentUser) {
if ($share->getShareOwner() !== $currentUser && $share->getSharedBy() !== $currentUser) {
return $recipients;
}
} catch (ShareNotFound $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ Feature: Reshare by public link
And the public accesses the last created public link using the webUI
Then file "lorem.txt" should be listed on the webUI

@issue-36386
Scenario: user shares a public link via email
Given user "user1" has created folder "/simple-folder"
And user "user1" has shared folder "/simple-folder" with user "user2" with permissions "share,read"
And parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
And user "user2" has logged in using the webUI
#When the user creates a new public link for folder "simple-folder" using the webUI with
When the user tries to create a new public link for folder "simple-folder" using the webUI with
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co |
#Then the email address "foo@bar.co" should have received an email with the body containing
# """
# User Two shared simple-folder with you
# """
#And the email address "foo@bar.co" should have received an email containing the last shared public link
Then dialog should be displayed on the webUI
| title | content |
| An error occured while sending email | Couldn't send mail to following recipient(s): foo@bar.co |
Then the email address "foo@bar.co" should have received an email with the body containing
"""
User Two shared simple-folder with you
"""
And the email address "foo@bar.co" should have received an email containing the last shared public link

0 comments on commit 5503eb7

Please sign in to comment.