{"action":"created","comment":{"url":"https://api.github.com/repos/ilios/ilios/pulls/comments/49004458","id":49004458,"diff_hunk":"@@ -21,34 +20,42 @@ class IcsController extends Controller\n \n     public function indexAction(Request $request, $key)\n     {\n-        $userManager = $this->container->get('ilioscore.user.manager');\n-        $user = $userManager->findUserBy(array('icsFeedKey' => $key));\n-        \n+        $userHandler = $this->container->get('ilioscore.user.handler');\n+        $user = $userHandler->findUserBy(array('icsFeedKey' => $key));\n+\n         if (!$user) {\n             throw new NotFoundHttpException();\n         }\n-        \n+\n         $calendar = new ICS\\Calendar('Ilios Calendar for ' . $user->getFirstAndLastName());\n         $calendar->setPublishedTTL('P1H');\n         \n         $from = new \\DateTime(self::LOOK_BACK);\n         $to =  new \\DateTime(self::LOOK_FORWARD);\n \n-        $events = $userManager->findEventsForUser(\n-            $user->getId(),\n-            $from,\n-            $to\n-        );\n+        $events = $userHandler->addInstructorsToEvents($userHandler->findEventsForUser($user->getId(), $from, $to));\n+\n+        //Only show published events\n+        $events = array_filter($events, function ($event) {","path":"src/Ilios/WebBundle/Controller/IcsController.php","position":null,"original_position":37,"commit_id":"958a4eebab26a72c85c884584976f03d28870e0c","original_commit_id":"b2af67b5486867a1305477200f0f12ef48f1ca9c","user":{"login":"jrjohnson","id":349624,"avatar_url":"https://avatars.githubusercontent.com/u/349624?v=3","gravatar_id":"","url":"https://api.github.com/users/jrjohnson","html_url":"https://github.com/jrjohnson","followers_url":"https://api.github.com/users/jrjohnson/followers","following_url":"https://api.github.com/users/jrjohnson/following{/other_user}","gists_url":"https://api.github.com/users/jrjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrjohnson/subscriptions","organizations_url":"https://api.github.com/users/jrjohnson/orgs","repos_url":"https://api.github.com/users/jrjohnson/repos","events_url":"https://api.github.com/users/jrjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/jrjohnson/received_events","type":"User","site_admin":false},"body":"Good call - refactored a bit to not add details to non-published or scheduled events.","created_at":"2016-01-06T20:19:27Z","updated_at":"2016-01-06T20:19:27Z","html_url":"https://github.com/ilios/ilios/pull/1236#discussion_r49004458","pull_request_url":"https://api.github.com/repos/ilios/ilios/pulls/1236","_links":{"self":{"href":"https://api.github.com/repos/ilios/ilios/pulls/comments/49004458"},"html":{"href":"https://github.com/ilios/ilios/pull/1236#discussion_r49004458"},"pull_request":{"href":"https://api.github.com/repos/ilios/ilios/pulls/1236"}}},"pull_request":{"url":"https://api.github.com/repos/ilios/ilios/pulls/1236","id":55250681,"html_url":"https://github.com/ilios/ilios/pull/1236","diff_url":"https://github.com/ilios/ilios/pull/1236.diff","patch_url":"https://github.com/ilios/ilios/pull/1236.patch","issue_url":"https://api.github.com/repos/ilios/ilios/issues/1236","number":1236,"state":"open","locked":false,"title":"Hide unpublished info from the ICS feed","user":{"login":"jrjohnson","id":349624,"avatar_url":"https://avatars.githubusercontent.com/u/349624?v=3","gravatar_id":"","url":"https://api.github.com/users/jrjohnson","html_url":"https://github.com/jrjohnson","followers_url":"https://api.github.com/users/jrjohnson/followers","following_url":"https://api.github.com/users/jrjohnson/following{/other_user}","gists_url":"https://api.github.com/users/jrjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrjohnson/subscriptions","organizations_url":"https://api.github.com/users/jrjohnson/orgs","repos_url":"https://api.github.com/users/jrjohnson/repos","events_url":"https://api.github.com/users/jrjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/jrjohnson/received_events","type":"User","site_admin":false},"body":"Don’t show anything that isn’t published and display only title and\ndate for scheduled stuff.\n\nFixes #1235","created_at":"2016-01-06T19:06:56Z","updated_at":"2016-01-06T20:19:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"785e62a30e338ed30f7856592af8d556dc5e4756","assignee":{"login":"thecoolestguy","id":248570,"avatar_url":"https://avatars.githubusercontent.com/u/248570?v=3","gravatar_id":"","url":"https://api.github.com/users/thecoolestguy","html_url":"https://github.com/thecoolestguy","followers_url":"https://api.github.com/users/thecoolestguy/followers","following_url":"https://api.github.com/users/thecoolestguy/following{/other_user}","gists_url":"https://api.github.com/users/thecoolestguy/gists{/gist_id}","starred_url":"https://api.github.com/users/thecoolestguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecoolestguy/subscriptions","organizations_url":"https://api.github.com/users/thecoolestguy/orgs","repos_url":"https://api.github.com/users/thecoolestguy/repos","events_url":"https://api.github.com/users/thecoolestguy/events{/privacy}","received_events_url":"https://api.github.com/users/thecoolestguy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ilios/ilios/pulls/1236/commits","review_comments_url":"https://api.github.com/repos/ilios/ilios/pulls/1236/comments","review_comment_url":"https://api.github.com/repos/ilios/ilios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ilios/ilios/issues/1236/comments","statuses_url":"https://api.github.com/repos/ilios/ilios/statuses/958a4eebab26a72c85c884584976f03d28870e0c","head":{"label":"jrjohnson:1235-publishedinfeed","ref":"1235-publishedinfeed","sha":"958a4eebab26a72c85c884584976f03d28870e0c","user":{"login":"jrjohnson","id":349624,"avatar_url":"https://avatars.githubusercontent.com/u/349624?v=3","gravatar_id":"","url":"https://api.github.com/users/jrjohnson","html_url":"https://github.com/jrjohnson","followers_url":"https://api.github.com/users/jrjohnson/followers","following_url":"https://api.github.com/users/jrjohnson/following{/other_user}","gists_url":"https://api.github.com/users/jrjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrjohnson/subscriptions","organizations_url":"https://api.github.com/users/jrjohnson/orgs","repos_url":"https://api.github.com/users/jrjohnson/repos","events_url":"https://api.github.com/users/jrjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/jrjohnson/received_events","type":"User","site_admin":false},"repo":{"id":17072959,"name":"ilios","full_name":"jrjohnson/ilios","owner":{"login":"jrjohnson","id":349624,"avatar_url":"https://avatars.githubusercontent.com/u/349624?v=3","gravatar_id":"","url":"https://api.github.com/users/jrjohnson","html_url":"https://github.com/jrjohnson","followers_url":"https://api.github.com/users/jrjohnson/followers","following_url":"https://api.github.com/users/jrjohnson/following{/other_user}","gists_url":"https://api.github.com/users/jrjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/jrjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrjohnson/subscriptions","organizations_url":"https://api.github.com/users/jrjohnson/orgs","repos_url":"https://api.github.com/users/jrjohnson/repos","events_url":"https://api.github.com/users/jrjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/jrjohnson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jrjohnson/ilios","description":"Curriculum Management System for the Health Professions","fork":true,"url":"https://api.github.com/repos/jrjohnson/ilios","forks_url":"https://api.github.com/repos/jrjohnson/ilios/forks","keys_url":"https://api.github.com/repos/jrjohnson/ilios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jrjohnson/ilios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jrjohnson/ilios/teams","hooks_url":"https://api.github.com/repos/jrjohnson/ilios/hooks","issue_events_url":"https://api.github.com/repos/jrjohnson/ilios/issues/events{/number}","events_url":"https://api.github.com/repos/jrjohnson/ilios/events","assignees_url":"https://api.github.com/repos/jrjohnson/ilios/assignees{/user}","branches_url":"https://api.github.com/repos/jrjohnson/ilios/branches{/branch}","tags_url":"https://api.github.com/repos/jrjohnson/ilios/tags","blobs_url":"https://api.github.com/repos/jrjohnson/ilios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jrjohnson/ilios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jrjohnson/ilios/git/refs{/sha}","trees_url":"https://api.github.com/repos/jrjohnson/ilios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jrjohnson/ilios/statuses/{sha}","languages_url":"https://api.github.com/repos/jrjohnson/ilios/languages","stargazers_url":"https://api.github.com/repos/jrjohnson/ilios/stargazers","contributors_url":"https://api.github.com/repos/jrjohnson/ilios/contributors","subscribers_url":"https://api.github.com/repos/jrjohnson/ilios/subscribers","subscription_url":"https://api.github.com/repos/jrjohnson/ilios/subscription","commits_url":"https://api.github.com/repos/jrjohnson/ilios/commits{/sha}","git_commits_url":"https://api.github.com/repos/jrjohnson/ilios/git/commits{/sha}","comments_url":"https://api.github.com/repos/jrjohnson/ilios/comments{/number}","issue_comment_url":"https://api.github.com/repos/jrjohnson/ilios/issues/comments{/number}","contents_url":"https://api.github.com/repos/jrjohnson/ilios/contents/{+path}","compare_url":"https://api.github.com/repos/jrjohnson/ilios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jrjohnson/ilios/merges","archive_url":"https://api.github.com/repos/jrjohnson/ilios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jrjohnson/ilios/downloads","issues_url":"https://api.github.com/repos/jrjohnson/ilios/issues{/number}","pulls_url":"https://api.github.com/repos/jrjohnson/ilios/pulls{/number}","milestones_url":"https://api.github.com/repos/jrjohnson/ilios/milestones{/number}","notifications_url":"https://api.github.com/repos/jrjohnson/ilios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jrjohnson/ilios/labels{/name}","releases_url":"https://api.github.com/repos/jrjohnson/ilios/releases{/id}","created_at":"2014-02-21T23:08:16Z","updated_at":"2015-04-10T17:04:30Z","pushed_at":"2016-01-06T20:15:35Z","git_url":"git://github.com/jrjohnson/ilios.git","ssh_url":"git@github.com:jrjohnson/ilios.git","clone_url":"https://github.com/jrjohnson/ilios.git","svn_url":"https://github.com/jrjohnson/ilios","homepage":"https://www.iliosproject.org","size":45402,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ilios:master","ref":"master","sha":"b271c83e79c05855cafd926e5edeefed092a567e","user":{"login":"ilios","id":2955721,"avatar_url":"https://avatars.githubusercontent.com/u/2955721?v=3","gravatar_id":"","url":"https://api.github.com/users/ilios","html_url":"https://github.com/ilios","followers_url":"https://api.github.com/users/ilios/followers","following_url":"https://api.github.com/users/ilios/following{/other_user}","gists_url":"https://api.github.com/users/ilios/gists{/gist_id}","starred_url":"https://api.github.com/users/ilios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilios/subscriptions","organizations_url":"https://api.github.com/users/ilios/orgs","repos_url":"https://api.github.com/users/ilios/repos","events_url":"https://api.github.com/users/ilios/events{/privacy}","received_events_url":"https://api.github.com/users/ilios/received_events","type":"Organization","site_admin":false},"repo":{"id":7026531,"name":"ilios","full_name":"ilios/ilios","owner":{"login":"ilios","id":2955721,"avatar_url":"https://avatars.githubusercontent.com/u/2955721?v=3","gravatar_id":"","url":"https://api.github.com/users/ilios","html_url":"https://github.com/ilios","followers_url":"https://api.github.com/users/ilios/followers","following_url":"https://api.github.com/users/ilios/following{/other_user}","gists_url":"https://api.github.com/users/ilios/gists{/gist_id}","starred_url":"https://api.github.com/users/ilios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilios/subscriptions","organizations_url":"https://api.github.com/users/ilios/orgs","repos_url":"https://api.github.com/users/ilios/repos","events_url":"https://api.github.com/users/ilios/events{/privacy}","received_events_url":"https://api.github.com/users/ilios/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ilios/ilios","description":"Curriculum Management System for the Health Professions","fork":false,"url":"https://api.github.com/repos/ilios/ilios","forks_url":"https://api.github.com/repos/ilios/ilios/forks","keys_url":"https://api.github.com/repos/ilios/ilios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilios/ilios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilios/ilios/teams","hooks_url":"https://api.github.com/repos/ilios/ilios/hooks","issue_events_url":"https://api.github.com/repos/ilios/ilios/issues/events{/number}","events_url":"https://api.github.com/repos/ilios/ilios/events","assignees_url":"https://api.github.com/repos/ilios/ilios/assignees{/user}","branches_url":"https://api.github.com/repos/ilios/ilios/branches{/branch}","tags_url":"https://api.github.com/repos/ilios/ilios/tags","blobs_url":"https://api.github.com/repos/ilios/ilios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilios/ilios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilios/ilios/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilios/ilios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilios/ilios/statuses/{sha}","languages_url":"https://api.github.com/repos/ilios/ilios/languages","stargazers_url":"https://api.github.com/repos/ilios/ilios/stargazers","contributors_url":"https://api.github.com/repos/ilios/ilios/contributors","subscribers_url":"https://api.github.com/repos/ilios/ilios/subscribers","subscription_url":"https://api.github.com/repos/ilios/ilios/subscription","commits_url":"https://api.github.com/repos/ilios/ilios/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilios/ilios/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilios/ilios/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilios/ilios/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilios/ilios/contents/{+path}","compare_url":"https://api.github.com/repos/ilios/ilios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilios/ilios/merges","archive_url":"https://api.github.com/repos/ilios/ilios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilios/ilios/downloads","issues_url":"https://api.github.com/repos/ilios/ilios/issues{/number}","pulls_url":"https://api.github.com/repos/ilios/ilios/pulls{/number}","milestones_url":"https://api.github.com/repos/ilios/ilios/milestones{/number}","notifications_url":"https://api.github.com/repos/ilios/ilios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilios/ilios/labels{/name}","releases_url":"https://api.github.com/repos/ilios/ilios/releases{/id}","created_at":"2012-12-05T23:27:26Z","updated_at":"2015-12-19T05:45:11Z","pushed_at":"2016-01-06T20:15:35Z","git_url":"git://github.com/ilios/ilios.git","ssh_url":"git@github.com:ilios/ilios.git","clone_url":"https://github.com/ilios/ilios.git","svn_url":"https://github.com/ilios/ilios","homepage":"https://www.iliosproject.org","size":46045,"stargazers_count":18,"watchers_count":18,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":38,"forks":19,"open_issues":38,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ilios/ilios/pulls/1236"},"html":{"href":"https://github.com/ilios/ilios/pull/1236"},"issue":{"href":"https://api.github.com/repos/ilios/ilios/issues/1236"},"comments":{"href":"https://api.github.com/repos/ilios/ilios/issues/1236/comments"},"review_comments":{"href":"https://api.github.com/repos/ilios/ilios/pulls/1236/comments"},"review_comment":{"href":"https://api.github.com/repos/ilios/ilios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ilios/ilios/pulls/1236/commits"},"statuses":{"href":"https://api.github.com/repos/ilios/ilios/statuses/958a4eebab26a72c85c884584976f03d28870e0c"}}}}