{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/33826707","id":33826707,"diff_hunk":"@@ -323,4 +324,38 @@ public function getParent() {\n \tpublic function getName() {\n \t\treturn '';\n \t}\n+\n+\t/**\n+\t * Returns a view to user's files folder\n+\t *\n+\t * @param IUser $user user\n+\t * @return \\OCP\\Files\\Folder\n+\t */\n+\tpublic function getUserFolder(IUser $user = null) {\n+\t\tif ($user === null) {\n+\t\t\t$user = $this->user;\n+\t\t}\n+\t\t$userId = $user->getUID();\n+\n+\t\t\\OC\\Files\\Filesystem::initMountPoints($userId);\n+\t\t$dir = '/' . $userId;\n+\t\t$folder = null;\n+\n+\t\tif (!$this->nodeExists($dir)) {\n+\t\t\t$folder = $this->newFolder($dir);\n+\t\t} else {\n+\t\t\t$folder = $this->get($dir);\n+\t\t}\n+\n+\t\t$dir = '/files';\n+\t\tif (!$folder->nodeExists($dir)) {\n+\t\t\t$folder = $folder->newFolder($dir);\n+\t\t\t\\OC_Util::copySkeleton($user, $folder);","path":"lib/private/files/node/root.php","position":38,"original_position":38,"commit_id":"b8b2c536b26c7c8085f8a947bb8cad3df80027af","original_commit_id":"b8b2c536b26c7c8085f8a947bb8cad3df80027af","user":{"login":"Raydiation","id":195053,"avatar_url":"https://avatars.githubusercontent.com/u/195053?v=3","gravatar_id":"","url":"https://api.github.com/users/Raydiation","html_url":"https://github.com/Raydiation","followers_url":"https://api.github.com/users/Raydiation/followers","following_url":"https://api.github.com/users/Raydiation/following{/other_user}","gists_url":"https://api.github.com/users/Raydiation/gists{/gist_id}","starred_url":"https://api.github.com/users/Raydiation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raydiation/subscriptions","organizations_url":"https://api.github.com/users/Raydiation/orgs","repos_url":"https://api.github.com/users/Raydiation/repos","events_url":"https://api.github.com/users/Raydiation/events{/privacy}","received_events_url":"https://api.github.com/users/Raydiation/received_events","type":"User","site_admin":false},"body":"BTW this is a classic issue that arises from mixing data structures and service like behavior. The same reason why I also think that the new node api is not that nice to use","created_at":"2015-07-02T21:54:11Z","updated_at":"2015-07-02T21:54:11Z","html_url":"https://github.com/owncloud/core/pull/16965#discussion_r33826707","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/16965","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/33826707"},"html":{"href":"https://github.com/owncloud/core/pull/16965#discussion_r33826707"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/16965"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/16965","id":37798379,"html_url":"https://github.com/owncloud/core/pull/16965","diff_url":"https://github.com/owncloud/core/pull/16965.diff","patch_url":"https://github.com/owncloud/core/pull/16965.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/16965","number":16965,"state":"open","locked":false,"title":"Add getUserFolder to IRootFolder","user":{"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},"body":"* untangle DI of user specific folders\r\n* allows to autodetect the dependency\r\n\r\ncc @Raydiation @DeepDiver1975 \r\n\r\nReplaces #16929 and #16948\r\n\r\nWill help with https://github.com/owncloud/core/issues/17352","created_at":"2015-06-16T14:06:19Z","updated_at":"2015-07-02T21:54:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5ccc68b91d12af766a6281e8fea65fd0b08422d","assignee":{"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},"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/37","html_url":"https://github.com/owncloud/core/milestones/8.2-next","labels_url":"https://api.github.com/repos/owncloud/core/milestones/37/labels","id":993629,"number":37,"title":"8.2-next","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":654,"closed_issues":38,"state":"open","created_at":"2015-02-24T16:19:37Z","updated_at":"2015-07-02T21:26:33Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/16965/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/16965/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16965/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/b8b2c536b26c7c8085f8a947bb8cad3df80027af","head":{"label":"owncloud:getUserFolder-in-IRootFolder","ref":"getUserFolder-in-IRootFolder","sha":"b8b2c536b26c7c8085f8a947bb8cad3df80027af","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-07-02T14:38:00Z","pushed_at":"2015-07-02T21:26:30Z","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":"https://owncloud.org/","size":1021028,"stargazers_count":3416,"watchers_count":3416,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1095,"mirror_url":null,"open_issues_count":1929,"forks":1095,"open_issues":1929,"watchers":3416,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"829f6474ff4cd4e39647bcb5b68b5e5c0fb1b483","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-07-02T14:38:00Z","pushed_at":"2015-07-02T21:26:30Z","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":"https://owncloud.org/","size":1021028,"stargazers_count":3416,"watchers_count":3416,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1095,"mirror_url":null,"open_issues_count":1929,"forks":1095,"open_issues":1929,"watchers":3416,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/16965"},"html":{"href":"https://github.com/owncloud/core/pull/16965"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/16965"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/16965/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/16965/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/16965/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/b8b2c536b26c7c8085f8a947bb8cad3df80027af"}}}}