apps/sharebymail/lib/ShareByMailProvider.php
/**
	 * create activity if a file/folder was shared by mail
	 *
	 * @param IShare $share
	 */
create activity if a file/folder was shared by mail
@param IShare $share
create activity if a file / folder was shared by mail @param IShare $share
protected function createShareActivity(IShare $share) {
		$userFolder = $this->rootFolder->getUserFolder($share->getSharedBy());
		$this->publishActivity(
			Activity::SUBJECT_SHARED_EMAIL_SELF,
			[$userFolder->getRelativePath($share->getNode()->getPath()), $share->getSharedWith()],
			$share->getSharedBy(),
			$share->getNode()->getId(),
			$userFolder->getRelativePath($share->getNode()->getPath())
		);
		if ($share->getShareOwner() !== $share->getSharedBy()) {
			$ownerFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
			$fileId = $share->getNode()->getId();
			$nodes = $ownerFolder->getById($fileId);
			$ownerPath = $nodes[0]->getPath();
			$this->publishActivity(
				Activity::SUBJECT_SHARED_EMAIL_BY,
				[$ownerFolder->getRelativePath($ownerPath), $share->getSharedWith(), $share->getSharedBy()],
				$share->getShareOwner(),
				$fileId,
				$ownerFolder->getRelativePath($ownerPath)
			);
		}
	}
protected function createShareActivity ( IShare $ share ) { $ userFolder = $ this -> rootFolder -> getUserFolder ( $ share -> getSharedBy ( ) ) ; $ this -> publishActivity ( Activity :: SUBJECT_SHARED_EMAIL_SELF , [ $ userFolder -> getRelativePath ( $ share -> getNode ( ) -> getPath ( ) ) , $ share -> getSharedWith ( ) ] , $ share -> getSharedBy ( ) , $ share -> getNode ( ) -> getId ( ) , $ userFolder -> getRelativePath ( $ share -> getNode ( ) -> getPath ( ) ) ) ; if ( $ share -> getShareOwner ( ) !== $ share -> getSharedBy ( ) ) { $ ownerFolder = $ this -> rootFolder -> getUserFolder ( $ share -> getShareOwner ( ) ) ; $ fileId = $ share -> getNode ( ) -> getId ( ) ; $ nodes = $ ownerFolder -> getById ( $ fileId ) ; $ ownerPath = $ nodes [ 0 ] -> getPath ( ) ; $ this -> publishActivity ( Activity :: SUBJECT_SHARED_EMAIL_BY , [ $ ownerFolder -> getRelativePath ( $ ownerPath ) , $ share -> getSharedWith ( ) , $ share -> getSharedBy ( ) ] , $ share -> getShareOwner ( ) , $ fileId , $ ownerFolder -> getRelativePath ( $ ownerPath ) ) ; } }
create activity if a file/folder was shared by mail
 @param IShare $share
create activity if a file / folder was shared by mail @param IShare $share