{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/synapse/pulls/comments/245371597","pull_request_review_id":189464338,"id":245371597,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTM3MTU5Nw==","diff_hunk":"@@ -368,13 +370,16 @@ def check(self, event):\n \n             room_id = event.get(\"room_id\", None)\n             ev_type = event.get(\"type\", None)\n-            is_url = \"url\" in event.get(\"content\", {})\n+\n+            content = event.get(\"content\", {})\n+            # check if there is a string url field in the content for filtering purposes\n+            contains_url = isinstance(content.get(\"url\"), text_type)","path":"synapse/api/filtering.py","position":26,"original_position":26,"commit_id":"fcd386152dd65f9785d1bd7e6983ea50df2a64ed","original_commit_id":"fcd386152dd65f9785d1bd7e6983ea50df2a64ed","user":{"login":"turt2live","id":1190097,"node_id":"MDQ6VXNlcjExOTAwOTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1190097?v=4","gravatar_id":"","url":"https://api.github.com/users/turt2live","html_url":"https://github.com/turt2live","followers_url":"https://api.github.com/users/turt2live/followers","following_url":"https://api.github.com/users/turt2live/following{/other_user}","gists_url":"https://api.github.com/users/turt2live/gists{/gist_id}","starred_url":"https://api.github.com/users/turt2live/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turt2live/subscriptions","organizations_url":"https://api.github.com/users/turt2live/orgs","repos_url":"https://api.github.com/users/turt2live/repos","events_url":"https://api.github.com/users/turt2live/events{/privacy}","received_events_url":"https://api.github.com/users/turt2live/received_events","type":"User","site_admin":false},"body":"(this might be a good opportunity to clarify the spec so it makes sense)","created_at":"2019-01-04T17:52:52Z","updated_at":"2019-01-04T17:52:52Z","html_url":"https://github.com/matrix-org/synapse/pull/3405#discussion_r245371597","pull_request_url":"https://api.github.com/repos/matrix-org/synapse/pulls/3405","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/comments/245371597"},"html":{"href":"https://github.com/matrix-org/synapse/pull/3405#discussion_r245371597"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/3405"}},"in_reply_to_id":245367991},"pull_request":{"url":"https://api.github.com/repos/matrix-org/synapse/pulls/3405","id":195371718,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzcxNzE4","html_url":"https://github.com/matrix-org/synapse/pull/3405","diff_url":"https://github.com/matrix-org/synapse/pull/3405.diff","patch_url":"https://github.com/matrix-org/synapse/pull/3405.patch","issue_url":"https://api.github.com/repos/matrix-org/synapse/issues/3405","number":3405,"state":"open","locked":false,"title":"fix the check for whether `is_url` to match all the other ones in codebase","user":{"login":"t3chguy","id":2403652,"node_id":"MDQ6VXNlcjI0MDM2NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/2403652?v=4","gravatar_id":"","url":"https://api.github.com/users/t3chguy","html_url":"https://github.com/t3chguy","followers_url":"https://api.github.com/users/t3chguy/followers","following_url":"https://api.github.com/users/t3chguy/following{/other_user}","gists_url":"https://api.github.com/users/t3chguy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chguy/subscriptions","organizations_url":"https://api.github.com/users/t3chguy/orgs","repos_url":"https://api.github.com/users/t3chguy/repos","events_url":"https://api.github.com/users/t3chguy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chguy/received_events","type":"User","site_admin":false},"body":"as this one did not check whether the value was a string and only checked its existence whereas the other two checked for both\r\n\r\npartially addresses https://github.com/vector-im/riot-web/issues/6250","created_at":"2018-06-17T10:42:03Z","updated_at":"2019-01-04T17:52:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df4f1efc5c9270ffd1b5069e7e34144d2a6f9892","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/synapse/pulls/3405/commits","review_comments_url":"https://api.github.com/repos/matrix-org/synapse/pulls/3405/comments","review_comment_url":"https://api.github.com/repos/matrix-org/synapse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/synapse/issues/3405/comments","statuses_url":"https://api.github.com/repos/matrix-org/synapse/statuses/fcd386152dd65f9785d1bd7e6983ea50df2a64ed","head":{"label":"t3chguy:t3chguy/fix_contains-url_filtering","ref":"t3chguy/fix_contains-url_filtering","sha":"fcd386152dd65f9785d1bd7e6983ea50df2a64ed","user":{"login":"t3chguy","id":2403652,"node_id":"MDQ6VXNlcjI0MDM2NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/2403652?v=4","gravatar_id":"","url":"https://api.github.com/users/t3chguy","html_url":"https://github.com/t3chguy","followers_url":"https://api.github.com/users/t3chguy/followers","following_url":"https://api.github.com/users/t3chguy/following{/other_user}","gists_url":"https://api.github.com/users/t3chguy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chguy/subscriptions","organizations_url":"https://api.github.com/users/t3chguy/orgs","repos_url":"https://api.github.com/users/t3chguy/repos","events_url":"https://api.github.com/users/t3chguy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chguy/received_events","type":"User","site_admin":false},"repo":{"id":96349326,"node_id":"MDEwOlJlcG9zaXRvcnk5NjM0OTMyNg==","name":"synapse","full_name":"t3chguy/synapse","private":false,"owner":{"login":"t3chguy","id":2403652,"node_id":"MDQ6VXNlcjI0MDM2NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/2403652?v=4","gravatar_id":"","url":"https://api.github.com/users/t3chguy","html_url":"https://github.com/t3chguy","followers_url":"https://api.github.com/users/t3chguy/followers","following_url":"https://api.github.com/users/t3chguy/following{/other_user}","gists_url":"https://api.github.com/users/t3chguy/gists{/gist_id}","starred_url":"https://api.github.com/users/t3chguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t3chguy/subscriptions","organizations_url":"https://api.github.com/users/t3chguy/orgs","repos_url":"https://api.github.com/users/t3chguy/repos","events_url":"https://api.github.com/users/t3chguy/events{/privacy}","received_events_url":"https://api.github.com/users/t3chguy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/t3chguy/synapse","description":"Synapse: Matrix reference homeserver","fork":true,"url":"https://api.github.com/repos/t3chguy/synapse","forks_url":"https://api.github.com/repos/t3chguy/synapse/forks","keys_url":"https://api.github.com/repos/t3chguy/synapse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/t3chguy/synapse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/t3chguy/synapse/teams","hooks_url":"https://api.github.com/repos/t3chguy/synapse/hooks","issue_events_url":"https://api.github.com/repos/t3chguy/synapse/issues/events{/number}","events_url":"https://api.github.com/repos/t3chguy/synapse/events","assignees_url":"https://api.github.com/repos/t3chguy/synapse/assignees{/user}","branches_url":"https://api.github.com/repos/t3chguy/synapse/branches{/branch}","tags_url":"https://api.github.com/repos/t3chguy/synapse/tags","blobs_url":"https://api.github.com/repos/t3chguy/synapse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/t3chguy/synapse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/t3chguy/synapse/git/refs{/sha}","trees_url":"https://api.github.com/repos/t3chguy/synapse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/t3chguy/synapse/statuses/{sha}","languages_url":"https://api.github.com/repos/t3chguy/synapse/languages","stargazers_url":"https://api.github.com/repos/t3chguy/synapse/stargazers","contributors_url":"https://api.github.com/repos/t3chguy/synapse/contributors","subscribers_url":"https://api.github.com/repos/t3chguy/synapse/subscribers","subscription_url":"https://api.github.com/repos/t3chguy/synapse/subscription","commits_url":"https://api.github.com/repos/t3chguy/synapse/commits{/sha}","git_commits_url":"https://api.github.com/repos/t3chguy/synapse/git/commits{/sha}","comments_url":"https://api.github.com/repos/t3chguy/synapse/comments{/number}","issue_comment_url":"https://api.github.com/repos/t3chguy/synapse/issues/comments{/number}","contents_url":"https://api.github.com/repos/t3chguy/synapse/contents/{+path}","compare_url":"https://api.github.com/repos/t3chguy/synapse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/t3chguy/synapse/merges","archive_url":"https://api.github.com/repos/t3chguy/synapse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/t3chguy/synapse/downloads","issues_url":"https://api.github.com/repos/t3chguy/synapse/issues{/number}","pulls_url":"https://api.github.com/repos/t3chguy/synapse/pulls{/number}","milestones_url":"https://api.github.com/repos/t3chguy/synapse/milestones{/number}","notifications_url":"https://api.github.com/repos/t3chguy/synapse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/t3chguy/synapse/labels{/name}","releases_url":"https://api.github.com/repos/t3chguy/synapse/releases{/id}","deployments_url":"https://api.github.com/repos/t3chguy/synapse/deployments","created_at":"2017-07-05T18:27:48Z","updated_at":"2017-07-05T18:27:52Z","pushed_at":"2018-12-29T23:44:45Z","git_url":"git://github.com/t3chguy/synapse.git","ssh_url":"git@github.com:t3chguy/synapse.git","clone_url":"https://github.com/t3chguy/synapse.git","svn_url":"https://github.com/t3chguy/synapse","homepage":"http://matrix.org","size":21919,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matrix-org:develop","ref":"develop","sha":"d7843f47b6a4568bd17b18e33fe31e7dcd4c7ebd","user":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":22844864,"node_id":"MDEwOlJlcG9zaXRvcnkyMjg0NDg2NA==","name":"synapse","full_name":"matrix-org/synapse","private":false,"owner":{"login":"matrix-org","id":8418310,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0MTgzMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/8418310?v=4","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/matrix-org/synapse","description":"Synapse: Matrix reference homeserver","fork":false,"url":"https://api.github.com/repos/matrix-org/synapse","forks_url":"https://api.github.com/repos/matrix-org/synapse/forks","keys_url":"https://api.github.com/repos/matrix-org/synapse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/synapse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/synapse/teams","hooks_url":"https://api.github.com/repos/matrix-org/synapse/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/synapse/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/synapse/events","assignees_url":"https://api.github.com/repos/matrix-org/synapse/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/synapse/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/synapse/tags","blobs_url":"https://api.github.com/repos/matrix-org/synapse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/synapse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/synapse/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/synapse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/synapse/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/synapse/languages","stargazers_url":"https://api.github.com/repos/matrix-org/synapse/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/synapse/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/synapse/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/synapse/subscription","commits_url":"https://api.github.com/repos/matrix-org/synapse/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/synapse/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/synapse/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/synapse/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/synapse/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/synapse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/synapse/merges","archive_url":"https://api.github.com/repos/matrix-org/synapse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/synapse/downloads","issues_url":"https://api.github.com/repos/matrix-org/synapse/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/synapse/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/synapse/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/synapse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/synapse/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/synapse/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/synapse/deployments","created_at":"2014-08-11T15:51:42Z","updated_at":"2019-01-04T08:36:11Z","pushed_at":"2019-01-04T17:51:56Z","git_url":"git://github.com/matrix-org/synapse.git","ssh_url":"git@github.com:matrix-org/synapse.git","clone_url":"https://github.com/matrix-org/synapse.git","svn_url":"https://github.com/matrix-org/synapse","homepage":"http://matrix.org","size":24413,"stargazers_count":3509,"watchers_count":3509,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":515,"mirror_url":null,"archived":false,"open_issues_count":957,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":515,"open_issues":957,"watchers":3509,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/3405"},"html":{"href":"https://github.com/matrix-org/synapse/pull/3405"},"issue":{"href":"https://api.github.com/repos/matrix-org/synapse/issues/3405"},"comments":{"href":"https://api.github.com/repos/matrix-org/synapse/issues/3405/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/3405/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/synapse/pulls/3405/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/synapse/statuses/fcd386152dd65f9785d1bd7e6983ea50df2a64ed"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"turt2live"}}