/**
  * send the updated permission to the owner/initiator, if they are not the same
  *
  * @param IShare $share
  * @throws ShareNotFound
  * @throws \OC\HintException
  */
 protected function sendPermissionUpdate(IShare $share)
 {
     $remoteId = $this->getRemoteId($share);
     // if the local user is the owner we send the permission change to the initiator
     if ($this->userManager->userExists($share->getShareOwner())) {
         list(, $remote) = $this->addressHandler->splitUserRemote($share->getSharedBy());
     } else {
         // ... if not we send the permission change to the owner
         list(, $remote) = $this->addressHandler->splitUserRemote($share->getShareOwner());
     }
     $this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions());
 }