apps/activity/lib/FilesHooks.php
/**
	 * Sharing a file or folder with a user
	 *
	 * @param string $shareWith
	 * @param int $fileSource File ID that is being shared
	 * @param string $itemType File type that is being shared (file or folder)
	 * @param string $fileTarget File path
	 */
Sharing a file or folder with a user
@param string $shareWith
@param int $fileSource File ID that is being shared
@param string $itemType File type that is being shared (file or folder)
@param string $fileTarget File path
Sharing a file or folder with a user @param string $shareWith @param int $fileSource File ID that is being shared @param string $itemType File type that is being shared ( file or folder ) @param string $fileTarget File path
protected function shareWithUser($shareWith, $fileSource, $itemType, $fileTarget) {
		$this->shareNotificationForSharer('shared_user_self', $shareWith, $fileSource, $itemType);
		if ($this->currentUser->getUID() !== null) {
			$this->shareNotificationForOriginalOwners($this->currentUser->getUID(), 'reshared_user_by', $shareWith, $fileSource, $itemType);
		}
		$this->addNotificationsForUser(
			$shareWith, 'shared_with_by', [[$fileSource => $fileTarget], $this->currentUser->getUserIdentifier()],
			(int) $fileSource, $fileTarget, $itemType === 'file',
			$this->userSettings->getUserSetting($shareWith, 'stream', Files_Sharing::TYPE_SHARED),
			$this->userSettings->getUserSetting($shareWith, 'email', Files_Sharing::TYPE_SHARED) ? $this->userSettings->getUserSetting($shareWith, 'setting', 'batchtime') : 0
		);
	}
protected function shareWithUser ( $ shareWith , $ fileSource , $ itemType , $ fileTarget ) { $ this -> shareNotificationForSharer ( 'shared_user_self' , $ shareWith , $ fileSource , $ itemType ) ; if ( $ this -> currentUser -> getUID ( ) !== null ) { $ this -> shareNotificationForOriginalOwners ( $ this -> currentUser -> getUID ( ) , 'reshared_user_by' , $ shareWith , $ fileSource , $ itemType ) ; } $ this -> addNotificationsForUser ( $ shareWith , 'shared_with_by' , [ [ $ fileSource => $ fileTarget ] , $ this -> currentUser -> getUserIdentifier ( ) ] , ( int ) $ fileSource , $ fileTarget , $ itemType === 'file' , $ this -> userSettings -> getUserSetting ( $ shareWith , 'stream' , Files_Sharing :: TYPE_SHARED ) , $ this -> userSettings -> getUserSetting ( $ shareWith , 'email' , Files_Sharing :: TYPE_SHARED ) ? $ this -> userSettings -> getUserSetting ( $ shareWith , 'setting' , 'batchtime' ) : 0 ) ; }
Sharing a file or folder with a user
 @param string $shareWith
 @param int $fileSource File ID that is being shared
 @param string $itemType File type that is being shared (file or folder)
 @param string $fileTarget File path
Sharing a file or folder with a user @param string $shareWith @param int $fileSource File ID that is being shared @param string $itemType File type that is being shared ( file or folder ) @param string $fileTarget File path
// User performing the share // New shared user