diff options
author | dartcafe <github@dartcafe.de> | 2020-07-04 10:00:55 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-07-04 10:00:55 +0300 |
commit | e515d58b6c7115950e01e0ada93d605c6a5b7dcb (patch) | |
tree | 4a2d3e9add0ecbc9ced881ae0100b3cd65f74d9c /lib/Service | |
parent | 1230e822b36017a8c693a780f379705e899d1140 (diff) |
track invitation sent in share
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/MailService.php | 2 | ||||
-rw-r--r-- | lib/Service/ShareService.php | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php index b285b99b..d1a73c3a 100644 --- a/lib/Service/MailService.php +++ b/lib/Service/MailService.php @@ -300,6 +300,8 @@ class MailService { $recipient['eMailAddress'], $recipient['displayName'] ); + $share->setInvitationSent(time()); + $this->shareMapper->update($share); $sentMails[] = $recipient; } catch (Exception $e) { $abortedMails[] = $recipient; diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index a7cf144b..bdc4177c 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -101,7 +101,6 @@ class ShareService { * @param string $share * @return array */ - // TODO: Replace with $this->add and separate sending invitations public function write($pollId, $type, $userId, $userEmail = '') { if (!$this->acl->setPollId($pollId)->getAllowEdit()) { @@ -113,6 +112,7 @@ class ShareService { $this->share->setPollId($pollId); $this->share->setUserId($userId); $this->share->setUserEmail($userEmail); + $this->share->setInvitationSent(0); $this->share->setToken(\OC::$server->getSecureRandom()->generate( 16, ISecureRandom::CHAR_DIGITS . @@ -121,6 +121,7 @@ class ShareService { )); $this->share = $this->shareMapper->insert($this->share); + // TODO: Replace with $this->add and separate sending invitations $sendResult = $this->mailService->sendInvitationMail($this->share->getToken()); return [ @@ -147,6 +148,7 @@ class ShareService { $this->share->setPollId($pollId); $this->share->setUserId($userId); $this->share->setUserEmail($userEmail); + $this->share->setInvitationSent(0); $this->share->setToken(\OC::$server->getSecureRandom()->generate( 16, ISecureRandom::CHAR_DIGITS . @@ -191,6 +193,7 @@ class ShareService { $this->share->setPollId($publicShare->getPollId()); $this->share->setUserId($userName); $this->share->setUserEmail(''); + $this->share->setInvitationSent(time()); return $this->shareMapper->insert($this->share); } elseif ($publicShare->getType() === 'email') { |