{"action":"created","comment":{"url":"https://api.github.com/repos/otavanopisto/muikku/pulls/comments/236547033","pull_request_review_id":178640666,"id":236547033,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjU0NzAzMw==","diff_hunk":"@@ -30,16 +37,30 @@\n   @Inject\n   private ChatSyncController chatSyncController;\n   \n+  @Inject\n+  private ChatController chatController;\n+  \n   @Inject\n   private WorkspaceEntityController workspaceEntityController;\n   \n+  @Inject\n+  private WorkspaceUserEntityController workspaceUserEntityController;\n+  \n   public synchronized void onSchoolDataWorkspaceUserDiscoveredEvent(@Observes SchoolDataWorkspaceUserDiscoveredEvent event) {\n     //kun kurssille pelmahtaa uusi opiskelija\n-    \n     String userIdentifier = event.getUserIdentifier();\n     String userDataSource = event.getUserDataSource();\n     SchoolDataIdentifier user = new SchoolDataIdentifier(userIdentifier, userDataSource);\n-    chatSyncController.syncStudent(user);\n+    String workspaceDataSource = event.getWorkspaceDataSource();\n+    String workspaceIdentifier = event.getWorkspaceIdentifier();\n+    \n+    WorkspaceEntity workspace = workspaceEntityController.findWorkspaceByDataSourceAndIdentifier(workspaceDataSource, workspaceIdentifier);\n+    \n+    WorkspaceChatSettings workspaceChatStatus = chatController.findWorkspaceChatSettings(workspace.getId());\n+\n+    if (workspaceChatStatus.getStatus() == WorkspaceChatStatus.ENABLED) {","path":"muikku-core-plugins/src/main/java/fi/otavanopisto/muikku/plugins/chat/SyncStudentEventHandler.java","position":54,"original_position":54,"commit_id":"e04a8f2d469f29d8a687abb809df2fd7f7d915e8","original_commit_id":"e04a8f2d469f29d8a687abb809df2fd7f7d915e8","user":{"login":"anttiviljakainen","id":2852275,"node_id":"MDQ6VXNlcjI4NTIyNzU=","avatar_url":"https://avatars1.githubusercontent.com/u/2852275?v=4","gravatar_id":"","url":"https://api.github.com/users/anttiviljakainen","html_url":"https://github.com/anttiviljakainen","followers_url":"https://api.github.com/users/anttiviljakainen/followers","following_url":"https://api.github.com/users/anttiviljakainen/following{/other_user}","gists_url":"https://api.github.com/users/anttiviljakainen/gists{/gist_id}","starred_url":"https://api.github.com/users/anttiviljakainen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anttiviljakainen/subscriptions","organizations_url":"https://api.github.com/users/anttiviljakainen/orgs","repos_url":"https://api.github.com/users/anttiviljakainen/repos","events_url":"https://api.github.com/users/anttiviljakainen/events{/privacy}","received_events_url":"https://api.github.com/users/anttiviljakainen/received_events","type":"User","site_admin":false},"body":"Can workspaceChatStatus be null? If it can, this should have null check.","created_at":"2018-11-27T07:36:50Z","updated_at":"2018-11-27T07:59:59Z","html_url":"https://github.com/otavanopisto/muikku/pull/4294#discussion_r236547033","pull_request_url":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/comments/236547033"},"html":{"href":"https://github.com/otavanopisto/muikku/pull/4294#discussion_r236547033"},"pull_request":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294"}}},"pull_request":{"url":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294","id":232313599,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMzEzNTk5","html_url":"https://github.com/otavanopisto/muikku/pull/4294","diff_url":"https://github.com/otavanopisto/muikku/pull/4294.diff","patch_url":"https://github.com/otavanopisto/muikku/pull/4294.patch","issue_url":"https://api.github.com/repos/otavanopisto/muikku/issues/4294","number":4294,"state":"open","locked":false,"title":"closes #4249 Sync active course students to course chat rooms","user":{"login":"saaralepisto","id":31776794,"node_id":"MDQ6VXNlcjMxNzc2Nzk0","avatar_url":"https://avatars1.githubusercontent.com/u/31776794?v=4","gravatar_id":"","url":"https://api.github.com/users/saaralepisto","html_url":"https://github.com/saaralepisto","followers_url":"https://api.github.com/users/saaralepisto/followers","following_url":"https://api.github.com/users/saaralepisto/following{/other_user}","gists_url":"https://api.github.com/users/saaralepisto/gists{/gist_id}","starred_url":"https://api.github.com/users/saaralepisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saaralepisto/subscriptions","organizations_url":"https://api.github.com/users/saaralepisto/orgs","repos_url":"https://api.github.com/users/saaralepisto/repos","events_url":"https://api.github.com/users/saaralepisto/events{/privacy}","received_events_url":"https://api.github.com/users/saaralepisto/received_events","type":"User","site_admin":false},"body":"closes #4249  Sync active course students to course chat rooms","created_at":"2018-11-20T13:17:57Z","updated_at":"2018-11-27T07:59:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd4beae1e9639341b3adc4ae10cb65832734c21b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":190870172,"node_id":"MDU6TGFiZWwxOTA4NzAxNzI=","url":"https://api.github.com/repos/otavanopisto/muikku/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294/commits","review_comments_url":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294/comments","review_comment_url":"https://api.github.com/repos/otavanopisto/muikku/pulls/comments{/number}","comments_url":"https://api.github.com/repos/otavanopisto/muikku/issues/4294/comments","statuses_url":"https://api.github.com/repos/otavanopisto/muikku/statuses/e04a8f2d469f29d8a687abb809df2fd7f7d915e8","head":{"label":"otavanopisto:FTR_4249_Sync_active_course_students_to_course_chat_rooms","ref":"FTR_4249_Sync_active_course_students_to_course_chat_rooms","sha":"e04a8f2d469f29d8a687abb809df2fd7f7d915e8","user":{"login":"otavanopisto","id":3909061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDkwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/3909061?v=4","gravatar_id":"","url":"https://api.github.com/users/otavanopisto","html_url":"https://github.com/otavanopisto","followers_url":"https://api.github.com/users/otavanopisto/followers","following_url":"https://api.github.com/users/otavanopisto/following{/other_user}","gists_url":"https://api.github.com/users/otavanopisto/gists{/gist_id}","starred_url":"https://api.github.com/users/otavanopisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavanopisto/subscriptions","organizations_url":"https://api.github.com/users/otavanopisto/orgs","repos_url":"https://api.github.com/users/otavanopisto/repos","events_url":"https://api.github.com/users/otavanopisto/events{/privacy}","received_events_url":"https://api.github.com/users/otavanopisto/received_events","type":"Organization","site_admin":false},"repo":{"id":8877030,"node_id":"MDEwOlJlcG9zaXRvcnk4ODc3MDMw","name":"muikku","full_name":"otavanopisto/muikku","private":false,"owner":{"login":"otavanopisto","id":3909061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDkwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/3909061?v=4","gravatar_id":"","url":"https://api.github.com/users/otavanopisto","html_url":"https://github.com/otavanopisto","followers_url":"https://api.github.com/users/otavanopisto/followers","following_url":"https://api.github.com/users/otavanopisto/following{/other_user}","gists_url":"https://api.github.com/users/otavanopisto/gists{/gist_id}","starred_url":"https://api.github.com/users/otavanopisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavanopisto/subscriptions","organizations_url":"https://api.github.com/users/otavanopisto/orgs","repos_url":"https://api.github.com/users/otavanopisto/repos","events_url":"https://api.github.com/users/otavanopisto/events{/privacy}","received_events_url":"https://api.github.com/users/otavanopisto/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/otavanopisto/muikku","description":"Muikku Learning Environment","fork":false,"url":"https://api.github.com/repos/otavanopisto/muikku","forks_url":"https://api.github.com/repos/otavanopisto/muikku/forks","keys_url":"https://api.github.com/repos/otavanopisto/muikku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otavanopisto/muikku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otavanopisto/muikku/teams","hooks_url":"https://api.github.com/repos/otavanopisto/muikku/hooks","issue_events_url":"https://api.github.com/repos/otavanopisto/muikku/issues/events{/number}","events_url":"https://api.github.com/repos/otavanopisto/muikku/events","assignees_url":"https://api.github.com/repos/otavanopisto/muikku/assignees{/user}","branches_url":"https://api.github.com/repos/otavanopisto/muikku/branches{/branch}","tags_url":"https://api.github.com/repos/otavanopisto/muikku/tags","blobs_url":"https://api.github.com/repos/otavanopisto/muikku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otavanopisto/muikku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otavanopisto/muikku/git/refs{/sha}","trees_url":"https://api.github.com/repos/otavanopisto/muikku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otavanopisto/muikku/statuses/{sha}","languages_url":"https://api.github.com/repos/otavanopisto/muikku/languages","stargazers_url":"https://api.github.com/repos/otavanopisto/muikku/stargazers","contributors_url":"https://api.github.com/repos/otavanopisto/muikku/contributors","subscribers_url":"https://api.github.com/repos/otavanopisto/muikku/subscribers","subscription_url":"https://api.github.com/repos/otavanopisto/muikku/subscription","commits_url":"https://api.github.com/repos/otavanopisto/muikku/commits{/sha}","git_commits_url":"https://api.github.com/repos/otavanopisto/muikku/git/commits{/sha}","comments_url":"https://api.github.com/repos/otavanopisto/muikku/comments{/number}","issue_comment_url":"https://api.github.com/repos/otavanopisto/muikku/issues/comments{/number}","contents_url":"https://api.github.com/repos/otavanopisto/muikku/contents/{+path}","compare_url":"https://api.github.com/repos/otavanopisto/muikku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otavanopisto/muikku/merges","archive_url":"https://api.github.com/repos/otavanopisto/muikku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otavanopisto/muikku/downloads","issues_url":"https://api.github.com/repos/otavanopisto/muikku/issues{/number}","pulls_url":"https://api.github.com/repos/otavanopisto/muikku/pulls{/number}","milestones_url":"https://api.github.com/repos/otavanopisto/muikku/milestones{/number}","notifications_url":"https://api.github.com/repos/otavanopisto/muikku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otavanopisto/muikku/labels{/name}","releases_url":"https://api.github.com/repos/otavanopisto/muikku/releases{/id}","deployments_url":"https://api.github.com/repos/otavanopisto/muikku/deployments","created_at":"2013-03-19T11:30:32Z","updated_at":"2018-11-27T06:51:41Z","pushed_at":"2018-11-27T07:56:09Z","git_url":"git://github.com/otavanopisto/muikku.git","ssh_url":"git@github.com:otavanopisto/muikku.git","clone_url":"https://github.com/otavanopisto/muikku.git","svn_url":"https://github.com/otavanopisto/muikku","homepage":null,"size":281393,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":613,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3,"open_issues":613,"watchers":6,"default_branch":"devel"}},"base":{"label":"otavanopisto:devel","ref":"devel","sha":"8cdee4766dbc612a537dfb37347fa114dcf9f9c1","user":{"login":"otavanopisto","id":3909061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDkwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/3909061?v=4","gravatar_id":"","url":"https://api.github.com/users/otavanopisto","html_url":"https://github.com/otavanopisto","followers_url":"https://api.github.com/users/otavanopisto/followers","following_url":"https://api.github.com/users/otavanopisto/following{/other_user}","gists_url":"https://api.github.com/users/otavanopisto/gists{/gist_id}","starred_url":"https://api.github.com/users/otavanopisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavanopisto/subscriptions","organizations_url":"https://api.github.com/users/otavanopisto/orgs","repos_url":"https://api.github.com/users/otavanopisto/repos","events_url":"https://api.github.com/users/otavanopisto/events{/privacy}","received_events_url":"https://api.github.com/users/otavanopisto/received_events","type":"Organization","site_admin":false},"repo":{"id":8877030,"node_id":"MDEwOlJlcG9zaXRvcnk4ODc3MDMw","name":"muikku","full_name":"otavanopisto/muikku","private":false,"owner":{"login":"otavanopisto","id":3909061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDkwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/3909061?v=4","gravatar_id":"","url":"https://api.github.com/users/otavanopisto","html_url":"https://github.com/otavanopisto","followers_url":"https://api.github.com/users/otavanopisto/followers","following_url":"https://api.github.com/users/otavanopisto/following{/other_user}","gists_url":"https://api.github.com/users/otavanopisto/gists{/gist_id}","starred_url":"https://api.github.com/users/otavanopisto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavanopisto/subscriptions","organizations_url":"https://api.github.com/users/otavanopisto/orgs","repos_url":"https://api.github.com/users/otavanopisto/repos","events_url":"https://api.github.com/users/otavanopisto/events{/privacy}","received_events_url":"https://api.github.com/users/otavanopisto/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/otavanopisto/muikku","description":"Muikku Learning Environment","fork":false,"url":"https://api.github.com/repos/otavanopisto/muikku","forks_url":"https://api.github.com/repos/otavanopisto/muikku/forks","keys_url":"https://api.github.com/repos/otavanopisto/muikku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otavanopisto/muikku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otavanopisto/muikku/teams","hooks_url":"https://api.github.com/repos/otavanopisto/muikku/hooks","issue_events_url":"https://api.github.com/repos/otavanopisto/muikku/issues/events{/number}","events_url":"https://api.github.com/repos/otavanopisto/muikku/events","assignees_url":"https://api.github.com/repos/otavanopisto/muikku/assignees{/user}","branches_url":"https://api.github.com/repos/otavanopisto/muikku/branches{/branch}","tags_url":"https://api.github.com/repos/otavanopisto/muikku/tags","blobs_url":"https://api.github.com/repos/otavanopisto/muikku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otavanopisto/muikku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otavanopisto/muikku/git/refs{/sha}","trees_url":"https://api.github.com/repos/otavanopisto/muikku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otavanopisto/muikku/statuses/{sha}","languages_url":"https://api.github.com/repos/otavanopisto/muikku/languages","stargazers_url":"https://api.github.com/repos/otavanopisto/muikku/stargazers","contributors_url":"https://api.github.com/repos/otavanopisto/muikku/contributors","subscribers_url":"https://api.github.com/repos/otavanopisto/muikku/subscribers","subscription_url":"https://api.github.com/repos/otavanopisto/muikku/subscription","commits_url":"https://api.github.com/repos/otavanopisto/muikku/commits{/sha}","git_commits_url":"https://api.github.com/repos/otavanopisto/muikku/git/commits{/sha}","comments_url":"https://api.github.com/repos/otavanopisto/muikku/comments{/number}","issue_comment_url":"https://api.github.com/repos/otavanopisto/muikku/issues/comments{/number}","contents_url":"https://api.github.com/repos/otavanopisto/muikku/contents/{+path}","compare_url":"https://api.github.com/repos/otavanopisto/muikku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otavanopisto/muikku/merges","archive_url":"https://api.github.com/repos/otavanopisto/muikku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otavanopisto/muikku/downloads","issues_url":"https://api.github.com/repos/otavanopisto/muikku/issues{/number}","pulls_url":"https://api.github.com/repos/otavanopisto/muikku/pulls{/number}","milestones_url":"https://api.github.com/repos/otavanopisto/muikku/milestones{/number}","notifications_url":"https://api.github.com/repos/otavanopisto/muikku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otavanopisto/muikku/labels{/name}","releases_url":"https://api.github.com/repos/otavanopisto/muikku/releases{/id}","deployments_url":"https://api.github.com/repos/otavanopisto/muikku/deployments","created_at":"2013-03-19T11:30:32Z","updated_at":"2018-11-27T06:51:41Z","pushed_at":"2018-11-27T07:56:09Z","git_url":"git://github.com/otavanopisto/muikku.git","ssh_url":"git@github.com:otavanopisto/muikku.git","clone_url":"https://github.com/otavanopisto/muikku.git","svn_url":"https://github.com/otavanopisto/muikku","homepage":null,"size":281393,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":613,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3,"open_issues":613,"watchers":6,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294"},"html":{"href":"https://github.com/otavanopisto/muikku/pull/4294"},"issue":{"href":"https://api.github.com/repos/otavanopisto/muikku/issues/4294"},"comments":{"href":"https://api.github.com/repos/otavanopisto/muikku/issues/4294/comments"},"review_comments":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294/comments"},"review_comment":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/otavanopisto/muikku/pulls/4294/commits"},"statuses":{"href":"https://api.github.com/repos/otavanopisto/muikku/statuses/e04a8f2d469f29d8a687abb809df2fd7f7d915e8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anttiviljakainen"}}