{"action":"created","comment":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments/194218474","pull_request_review_id":127356868,"id":194218474,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDIxODQ3NA==","diff_hunk":"@@ -65,8 +72,30 @@ function toExtendedProfile(profile: RetrievedProfile): ExtendedProfile {\n   };\n }\n \n-function toLimitedProfile(_: RetrievedProfile): LimitedProfile {\n-  return {};\n+/**\n+ * Whether the sender service is allowed to send\n+ * notififications to the user identified by this profile\n+ */\n+export function isSenderAllowed(\n+  blockedInboxOrChannels: IProfileBlockedInboxOrChannels | undefined,\n+  serviceId: ServiceId\n+): boolean {\n+  return (\n+    blockedInboxOrChannels === undefined ||\n+    blockedInboxOrChannels[serviceId] === undefined ||\n+    !blockedInboxOrChannels[serviceId].has(BlockedInboxOrChannelEnum.INBOX)\n+  );\n+}\n+\n+function toLimitedProfile(\n+  profile: RetrievedProfile,\n+  senderAllowed: boolean","path":"lib/controllers/profiles.ts","position":39,"original_position":39,"commit_id":"0af60fc12f99a628b45ae9012bd62f0485a51347","original_commit_id":"0af60fc12f99a628b45ae9012bd62f0485a51347","user":{"login":"cloudify","id":48206,"node_id":"MDQ6VXNlcjQ4MjA2","avatar_url":"https://avatars2.githubusercontent.com/u/48206?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudify","html_url":"https://github.com/cloudify","followers_url":"https://api.github.com/users/cloudify/followers","following_url":"https://api.github.com/users/cloudify/following{/other_user}","gists_url":"https://api.github.com/users/cloudify/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify/subscriptions","organizations_url":"https://api.github.com/users/cloudify/orgs","repos_url":"https://api.github.com/users/cloudify/repos","events_url":"https://api.github.com/users/cloudify/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify/received_events","type":"User","site_admin":false},"body":"`isSenderAllowed`","created_at":"2018-06-09T07:54:47Z","updated_at":"2018-06-09T07:54:47Z","html_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262#discussion_r194218474","pull_request_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments/194218474"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262#discussion_r194218474"},"pull_request":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262"}}},"pull_request":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262","id":193674336,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjc0MzM2","html_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262","diff_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262.diff","patch_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262.patch","issue_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/262","number":262,"state":"open","locked":false,"title":"[#158179629] feat: return sender_allowed with limited profile","user":{"login":"gunzip","id":148224,"node_id":"MDQ6VXNlcjE0ODIyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/148224?v=4","gravatar_id":"","url":"https://api.github.com/users/gunzip","html_url":"https://github.com/gunzip","followers_url":"https://api.github.com/users/gunzip/followers","following_url":"https://api.github.com/users/gunzip/following{/other_user}","gists_url":"https://api.github.com/users/gunzip/gists{/gist_id}","starred_url":"https://api.github.com/users/gunzip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunzip/subscriptions","organizations_url":"https://api.github.com/users/gunzip/orgs","repos_url":"https://api.github.com/users/gunzip/repos","events_url":"https://api.github.com/users/gunzip/events{/privacy}","received_events_url":"https://api.github.com/users/gunzip/received_events","type":"User","site_admin":false},"body":"we do not return the sender_allowed flag with full profile as with a full profile we got the whole array with blocked services","created_at":"2018-06-08T17:14:07Z","updated_at":"2018-06-09T07:54:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9b777c29cda14e5e73aeba788a250553b389ad9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262/commits","review_comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262/comments","review_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/262/comments","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/0af60fc12f99a628b45ae9012bd62f0485a51347","head":{"label":"teamdigitale:158179629-sender-allowed","ref":"158179629-sender-allowed","sha":"0af60fc12f99a628b45ae9012bd62f0485a51347","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":98789853,"node_id":"MDEwOlJlcG9zaXRvcnk5ODc4OTg1Mw==","name":"digital-citizenship-functions","full_name":"teamdigitale/digital-citizenship-functions","owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship-functions","description":"Digital Citizenship APIs","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/deployments","created_at":"2017-07-30T10:19:53Z","updated_at":"2018-06-04T07:21:46Z","pushed_at":"2018-06-08T21:43:17Z","git_url":"git://github.com/teamdigitale/digital-citizenship-functions.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship-functions.git","clone_url":"https://github.com/teamdigitale/digital-citizenship-functions.git","svn_url":"https://github.com/teamdigitale/digital-citizenship-functions","homepage":"","size":8034,"stargazers_count":3,"watchers_count":3,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"teamdigitale:master","ref":"master","sha":"9442026941840afc302003e33c500f83834b6942","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":98789853,"node_id":"MDEwOlJlcG9zaXRvcnk5ODc4OTg1Mw==","name":"digital-citizenship-functions","full_name":"teamdigitale/digital-citizenship-functions","owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship-functions","description":"Digital Citizenship APIs","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/deployments","created_at":"2017-07-30T10:19:53Z","updated_at":"2018-06-04T07:21:46Z","pushed_at":"2018-06-08T21:43:17Z","git_url":"git://github.com/teamdigitale/digital-citizenship-functions.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship-functions.git","clone_url":"https://github.com/teamdigitale/digital-citizenship-functions.git","svn_url":"https://github.com/teamdigitale/digital-citizenship-functions","homepage":"","size":8034,"stargazers_count":3,"watchers_count":3,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship-functions/pull/262"},"issue":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/262"},"comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/262/comments"},"review_comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262/comments"},"review_comment":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/262/commits"},"statuses":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/0af60fc12f99a628b45ae9012bd62f0485a51347"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"cloudify"}}