{"action":"created","comment":{"url":"https://api.github.com/repos/brave/browser-ios/pulls/comments/197079005","pull_request_review_id":130749041,"id":197079005,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzA3OTAwNQ==","diff_hunk":"@@ -219,21 +218,26 @@ open class FaviconFetcher : NSObject, XMLParserDelegate {\n         }\n         \n         if useFallback, let host = url.host, let letter = host.replacingOccurrences(of: \"www.\", with: \"\").first {\n-            var bgColor = FallbackIcon.color\n-            \n             let context = DataController.shared.mainThreadContext\n             \n-            // Only use stored color if it's not too light.\n-            if let domain = Domain.getOrCreateForUrl(cacheUrl, context: context),\n-                let colorString = domain.color,\n-                !UIColor(colorString: colorString).isLight {\n-                bgColor = UIColor(colorString: colorString)\n+            guard let domain = Domain.getOrCreateForUrl(cacheUrl, context: context) else {\n+                return (FaviconFetcher.defaultFavicon, false)\n             }\n             \n-            finalImage = FavoritesHelper.fallbackIcon(withLetter: String(letter), color: bgColor, andSize: FallbackIcon.size)\n+            var bgColor = FallbackIcon.color\n+            if let domainColor = domain.color {\n+                bgColor = UIColor(colorString: domainColor)\n+            }\n+            \n+            let fallback = FavoritesHelper.fallbackIcon(withLetter: String(letter), color: bgColor, andSize: FallbackIcon.size)\n+            return (fallback, false)\n         }\n         \n-        return finalImage ?? FaviconFetcher.defaultFavicon\n+        if let img = img {\n+            return (img, true)","path":"Utils/FaviconFetcher.swift","position":39,"original_position":39,"commit_id":"796ffc785d6ef16da0b1012cc15d9a19dc7f7ee3","original_commit_id":"796ffc785d6ef16da0b1012cc15d9a19dc7f7ee3","user":{"login":"iccub","id":6950387,"node_id":"MDQ6VXNlcjY5NTAzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/6950387?v=4","gravatar_id":"","url":"https://api.github.com/users/iccub","html_url":"https://github.com/iccub","followers_url":"https://api.github.com/users/iccub/followers","following_url":"https://api.github.com/users/iccub/following{/other_user}","gists_url":"https://api.github.com/users/iccub/gists{/gist_id}","starred_url":"https://api.github.com/users/iccub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iccub/subscriptions","organizations_url":"https://api.github.com/users/iccub/orgs","repos_url":"https://api.github.com/users/iccub/repos","events_url":"https://api.github.com/users/iccub/events{/privacy}","received_events_url":"https://api.github.com/users/iccub/received_events","type":"User","site_admin":false},"body":"I could reduce that to `return(img ?? FaviconFetcher.defaultFavicon, img != nil)` but it's less readable that way imo.","created_at":"2018-06-21T10:06:32Z","updated_at":"2018-06-21T10:06:32Z","html_url":"https://github.com/brave/browser-ios/pull/1644#discussion_r197079005","pull_request_url":"https://api.github.com/repos/brave/browser-ios/pulls/1644","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/comments/197079005"},"html":{"href":"https://github.com/brave/browser-ios/pull/1644#discussion_r197079005"},"pull_request":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/1644"}}},"pull_request":{"url":"https://api.github.com/repos/brave/browser-ios/pulls/1644","id":196399645,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2Mzk5NjQ1","html_url":"https://github.com/brave/browser-ios/pull/1644","diff_url":"https://github.com/brave/browser-ios/pull/1644.diff","patch_url":"https://github.com/brave/browser-ios/pull/1644.patch","issue_url":"https://api.github.com/repos/brave/browser-ios/issues/1644","number":1644,"state":"open","locked":false,"title":"Fix #1634, updated fallback icon logic.","user":{"login":"iccub","id":6950387,"node_id":"MDQ6VXNlcjY5NTAzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/6950387?v=4","gravatar_id":"","url":"https://api.github.com/users/iccub","html_url":"https://github.com/iccub","followers_url":"https://api.github.com/users/iccub/followers","following_url":"https://api.github.com/users/iccub/following{/other_user}","gists_url":"https://api.github.com/users/iccub/gists{/gist_id}","starred_url":"https://api.github.com/users/iccub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iccub/subscriptions","organizations_url":"https://api.github.com/users/iccub/orgs","repos_url":"https://api.github.com/users/iccub/repos","events_url":"https://api.github.com/users/iccub/events{/privacy}","received_events_url":"https://api.github.com/users/iccub/received_events","type":"User","site_admin":false},"body":"A grey border is added to only very light backgrounds for fallback icons.\r\n\r\nI have also removed fallback icons from caching so favorite tiles will always get updated once favicon is high quality enough. This also helped to distinguish between regular favicon and fallback, we need that check so only fallback icons will get a grey border(if light enough).","created_at":"2018-06-21T10:04:27Z","updated_at":"2018-06-21T10:06:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f9a2c8ecc0e936349ef1d64b4be00bd959b586","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/brave/browser-ios/pulls/1644/commits","review_comments_url":"https://api.github.com/repos/brave/browser-ios/pulls/1644/comments","review_comment_url":"https://api.github.com/repos/brave/browser-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brave/browser-ios/issues/1644/comments","statuses_url":"https://api.github.com/repos/brave/browser-ios/statuses/796ffc785d6ef16da0b1012cc15d9a19dc7f7ee3","head":{"label":"iccub:fallback-icon-update","ref":"fallback-icon-update","sha":"796ffc785d6ef16da0b1012cc15d9a19dc7f7ee3","user":{"login":"iccub","id":6950387,"node_id":"MDQ6VXNlcjY5NTAzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/6950387?v=4","gravatar_id":"","url":"https://api.github.com/users/iccub","html_url":"https://github.com/iccub","followers_url":"https://api.github.com/users/iccub/followers","following_url":"https://api.github.com/users/iccub/following{/other_user}","gists_url":"https://api.github.com/users/iccub/gists{/gist_id}","starred_url":"https://api.github.com/users/iccub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iccub/subscriptions","organizations_url":"https://api.github.com/users/iccub/orgs","repos_url":"https://api.github.com/users/iccub/repos","events_url":"https://api.github.com/users/iccub/events{/privacy}","received_events_url":"https://api.github.com/users/iccub/received_events","type":"User","site_admin":false},"repo":{"id":101985681,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE5ODU2ODE=","name":"browser-ios","full_name":"iccub/browser-ios","owner":{"login":"iccub","id":6950387,"node_id":"MDQ6VXNlcjY5NTAzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/6950387?v=4","gravatar_id":"","url":"https://api.github.com/users/iccub","html_url":"https://github.com/iccub","followers_url":"https://api.github.com/users/iccub/followers","following_url":"https://api.github.com/users/iccub/following{/other_user}","gists_url":"https://api.github.com/users/iccub/gists{/gist_id}","starred_url":"https://api.github.com/users/iccub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iccub/subscriptions","organizations_url":"https://api.github.com/users/iccub/orgs","repos_url":"https://api.github.com/users/iccub/repos","events_url":"https://api.github.com/users/iccub/events{/privacy}","received_events_url":"https://api.github.com/users/iccub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iccub/browser-ios","description":"Brave iOS Browser","fork":true,"url":"https://api.github.com/repos/iccub/browser-ios","forks_url":"https://api.github.com/repos/iccub/browser-ios/forks","keys_url":"https://api.github.com/repos/iccub/browser-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iccub/browser-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iccub/browser-ios/teams","hooks_url":"https://api.github.com/repos/iccub/browser-ios/hooks","issue_events_url":"https://api.github.com/repos/iccub/browser-ios/issues/events{/number}","events_url":"https://api.github.com/repos/iccub/browser-ios/events","assignees_url":"https://api.github.com/repos/iccub/browser-ios/assignees{/user}","branches_url":"https://api.github.com/repos/iccub/browser-ios/branches{/branch}","tags_url":"https://api.github.com/repos/iccub/browser-ios/tags","blobs_url":"https://api.github.com/repos/iccub/browser-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iccub/browser-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iccub/browser-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/iccub/browser-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iccub/browser-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/iccub/browser-ios/languages","stargazers_url":"https://api.github.com/repos/iccub/browser-ios/stargazers","contributors_url":"https://api.github.com/repos/iccub/browser-ios/contributors","subscribers_url":"https://api.github.com/repos/iccub/browser-ios/subscribers","subscription_url":"https://api.github.com/repos/iccub/browser-ios/subscription","commits_url":"https://api.github.com/repos/iccub/browser-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/iccub/browser-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/iccub/browser-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/iccub/browser-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/iccub/browser-ios/contents/{+path}","compare_url":"https://api.github.com/repos/iccub/browser-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iccub/browser-ios/merges","archive_url":"https://api.github.com/repos/iccub/browser-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iccub/browser-ios/downloads","issues_url":"https://api.github.com/repos/iccub/browser-ios/issues{/number}","pulls_url":"https://api.github.com/repos/iccub/browser-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/iccub/browser-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/iccub/browser-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iccub/browser-ios/labels{/name}","releases_url":"https://api.github.com/repos/iccub/browser-ios/releases{/id}","deployments_url":"https://api.github.com/repos/iccub/browser-ios/deployments","created_at":"2017-08-31T09:45:02Z","updated_at":"2018-06-08T16:24:25Z","pushed_at":"2018-06-21T09:58:35Z","git_url":"git://github.com/iccub/browser-ios.git","ssh_url":"git@github.com:iccub/browser-ios.git","clone_url":"https://github.com/iccub/browser-ios.git","svn_url":"https://github.com/iccub/browser-ios","homepage":"https://www.brave.com","size":458273,"stargazers_count":0,"watchers_count":0,"language":"C","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":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"brave:development","ref":"development","sha":"d001f29297e6e1aeb126ebf11af502fb7aa6e0f4","user":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"repo":{"id":44764615,"node_id":"MDEwOlJlcG9zaXRvcnk0NDc2NDYxNQ==","name":"browser-ios","full_name":"brave/browser-ios","owner":{"login":"brave","id":12301619,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAxNjE5","avatar_url":"https://avatars1.githubusercontent.com/u/12301619?v=4","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brave/browser-ios","description":"Brave iOS Browser","fork":false,"url":"https://api.github.com/repos/brave/browser-ios","forks_url":"https://api.github.com/repos/brave/browser-ios/forks","keys_url":"https://api.github.com/repos/brave/browser-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brave/browser-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brave/browser-ios/teams","hooks_url":"https://api.github.com/repos/brave/browser-ios/hooks","issue_events_url":"https://api.github.com/repos/brave/browser-ios/issues/events{/number}","events_url":"https://api.github.com/repos/brave/browser-ios/events","assignees_url":"https://api.github.com/repos/brave/browser-ios/assignees{/user}","branches_url":"https://api.github.com/repos/brave/browser-ios/branches{/branch}","tags_url":"https://api.github.com/repos/brave/browser-ios/tags","blobs_url":"https://api.github.com/repos/brave/browser-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brave/browser-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brave/browser-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/brave/browser-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brave/browser-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/brave/browser-ios/languages","stargazers_url":"https://api.github.com/repos/brave/browser-ios/stargazers","contributors_url":"https://api.github.com/repos/brave/browser-ios/contributors","subscribers_url":"https://api.github.com/repos/brave/browser-ios/subscribers","subscription_url":"https://api.github.com/repos/brave/browser-ios/subscription","commits_url":"https://api.github.com/repos/brave/browser-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/brave/browser-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/brave/browser-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/brave/browser-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/brave/browser-ios/contents/{+path}","compare_url":"https://api.github.com/repos/brave/browser-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brave/browser-ios/merges","archive_url":"https://api.github.com/repos/brave/browser-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brave/browser-ios/downloads","issues_url":"https://api.github.com/repos/brave/browser-ios/issues{/number}","pulls_url":"https://api.github.com/repos/brave/browser-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/brave/browser-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/brave/browser-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brave/browser-ios/labels{/name}","releases_url":"https://api.github.com/repos/brave/browser-ios/releases{/id}","deployments_url":"https://api.github.com/repos/brave/browser-ios/deployments","created_at":"2015-10-22T18:19:43Z","updated_at":"2018-06-18T02:18:20Z","pushed_at":"2018-06-21T10:04:27Z","git_url":"git://github.com/brave/browser-ios.git","ssh_url":"git@github.com:brave/browser-ios.git","clone_url":"https://github.com/brave/browser-ios.git","svn_url":"https://github.com/brave/browser-ios","homepage":"https://www.brave.com","size":505045,"stargazers_count":841,"watchers_count":841,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":160,"mirror_url":null,"archived":false,"open_issues_count":349,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":160,"open_issues":349,"watchers":841,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/1644"},"html":{"href":"https://github.com/brave/browser-ios/pull/1644"},"issue":{"href":"https://api.github.com/repos/brave/browser-ios/issues/1644"},"comments":{"href":"https://api.github.com/repos/brave/browser-ios/issues/1644/comments"},"review_comments":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/1644/comments"},"review_comment":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brave/browser-ios/pulls/1644/commits"},"statuses":{"href":"https://api.github.com/repos/brave/browser-ios/statuses/796ffc785d6ef16da0b1012cc15d9a19dc7f7ee3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"iccub"}}