{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/27965080","id":27965080,"diff_hunk":"@@ -0,0 +1,67 @@\n+<?php\n+/**\n+ * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com>\n+ * This file is licensed under the Affero General Public License version 3 or\n+ * later.\n+ * See the COPYING-README file.\n+ */\n+\n+namespace OCA\\Files_Sharing;\n+\n+use OCA\\Files_Sharing\\Propagation\\PropagationManager;\n+use OCP\\Files\\Config\\IMountProvider;\n+use OCP\\Files\\Storage\\IStorageFactory;\n+use OCP\\IConfig;\n+use OCP\\IUser;\n+\n+class MountProvider implements IMountProvider {\n+\t/**\n+\t * @var \\OCP\\IConfig\n+\t */\n+\tprotected $config;\n+\n+\t/**\n+\t * @var \\OCA\\Files_Sharing\\Propagation\\PropagationManager\n+\t */\n+\tprotected $propagationManager;\n+\n+\t/**\n+\t * @param \\OCP\\IConfig $config\n+\t * @param \\OCA\\Files_Sharing\\Propagation\\PropagationManager $propagationManager\n+\t */\n+\tfunction __construct(IConfig $config, PropagationManager $propagationManager) {\n+\t\t$this->config = $config;\n+\t\t$this->propagationManager = $propagationManager;\n+\t}\n+\n+\n+\t/**\n+\t * Get all mountpoints applicable for the user\n+\t *\n+\t * @param \\OCP\\IUser $user\n+\t * @param \\OCP\\Files\\Storage\\IStorageFactory $storageFactory\n+\t * @return \\OCP\\Files\\Mount\\IMountPoint[]\n+\t */\n+\tpublic function getMountsForUser(IUser $user, IStorageFactory $storageFactory) {\n+\t\t$shares = \\OCP\\Share::getItemsSharedWithUser('file', $user->getUID());\n+\t\t$propagator = $this->propagationManager->getSharePropagator($user->getUID());\n+\t\t$propagator->propagateDirtyMountPoints($shares);\n+\t\t$shares = array_filter($shares, function ($share) {\n+\t\t\treturn $share['permissions'] > 0;\n+\t\t});\n+\t\treturn array_map(function ($share) use ($user, $storageFactory) {\n+\t\t\t$ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']);\n+\t\t\t$this->propagationManager->listenToOwnerChanges($share['uid_owner'], $user->getUID());\n+\t\t\treturn new SharedMount(\n+\t\t\t\t'\\OC\\Files\\Storage\\Shared',\n+\t\t\t\t'/' . $user->getUID() . '/' . $share['file_target'],","path":"apps/files_sharing/lib/mountprovider.php","position":57,"original_position":57,"commit_id":"648f42af35c7812bf6d994ca51cb2b9a5ec596ee","original_commit_id":"648f42af35c7812bf6d994ca51cb2b9a5ec596ee","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"body":"note: file_target already contains a leading slash usually, hopefully nothing to worry about","created_at":"2015-04-08T12:38:45Z","updated_at":"2015-04-08T12:38:45Z","html_url":"https://github.com/owncloud/core/pull/14764#discussion_r27965080","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/14764","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/27965080"},"html":{"href":"https://github.com/owncloud/core/pull/14764#discussion_r27965080"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/14764"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/14764","id":30770136,"html_url":"https://github.com/owncloud/core/pull/14764","diff_url":"https://github.com/owncloud/core/pull/14764.diff","patch_url":"https://github.com/owncloud/core/pull/14764.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/14764","number":14764,"state":"open","locked":false,"title":"Propagate etags across shared storages","user":{"login":"icewind1991","id":1283854,"avatar_url":"https://avatars.githubusercontent.com/u/1283854?v=3","gravatar_id":"","url":"https://api.github.com/users/icewind1991","html_url":"https://github.com/icewind1991","followers_url":"https://api.github.com/users/icewind1991/followers","following_url":"https://api.github.com/users/icewind1991/following{/other_user}","gists_url":"https://api.github.com/users/icewind1991/gists{/gist_id}","starred_url":"https://api.github.com/users/icewind1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icewind1991/subscriptions","organizations_url":"https://api.github.com/users/icewind1991/orgs","repos_url":"https://api.github.com/users/icewind1991/repos","events_url":"https://api.github.com/users/icewind1991/events{/privacy}","received_events_url":"https://api.github.com/users/icewind1991/received_events","type":"User","site_admin":false},"body":"Solution involves three parts\r\n\r\n- Watch for filesystem changes made inside a shared mount, when detected, trigger the change propagator for the owner of the storage\r\n- Listen to the change propagator, when it updates the etag of a shared item, mark the shares as \"dirty\"\r\n- When setting up the filesystem, trigger the change propagator for each \"dirty\" mountpoint\r\n\r\ncc @PVince81 @DeepDiver1975 ","created_at":"2015-03-09T15:26:02Z","updated_at":"2015-04-08T12:38:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ad552aa8b940e51187fd0316a03d42a91b33f2d","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":195,"closed_issues":666,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-04-08T12:32:04Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/14764/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/14764/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/14764/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/648f42af35c7812bf6d994ca51cb2b9a5ec596ee","head":{"label":"owncloud:shared-etag-propagate","ref":"shared-etag-propagate","sha":"648f42af35c7812bf6d994ca51cb2b9a5ec596ee","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-04-08T12:30:57Z","pushed_at":"2015-04-08T12:30:58Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":989298,"stargazers_count":3208,"watchers_count":3208,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1023,"mirror_url":null,"open_issues_count":1677,"forks":1023,"open_issues":1677,"watchers":3208,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"c12dd2820ca8e4d989a8e4208cefb8b72a0f21fe","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-04-08T12:30:57Z","pushed_at":"2015-04-08T12:30:58Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":989298,"stargazers_count":3208,"watchers_count":3208,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1023,"mirror_url":null,"open_issues_count":1677,"forks":1023,"open_issues":1677,"watchers":3208,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/14764"},"html":{"href":"https://github.com/owncloud/core/pull/14764"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/14764"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/14764/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/14764/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/14764/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/648f42af35c7812bf6d994ca51cb2b9a5ec596ee"}}}}