{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/90019255","pull_request_review_id":10544734,"id":90019255,"diff_hunk":"@@ -0,0 +1,97 @@\n+import Foundation\n+\n+/// Helper class to create a WordPress URL for various download needs, like specifying image size or using Photon.\n+public class WPImageURLHelper: NSObject\n+{\n+    struct GravatarDefaults {\n+        static let scheme = RequestScheme.Secure.rawValue\n+        static let host = \"secure.\\(gravatarURLBase)\"\n+        // unknownHash = md5(\"unknown@gravatar.com\")\n+        static let unknownHash = \"ad516503a11cd5ca435acc9bb6523536\"\n+    }\n+\n+    enum RequestScheme: String {\n+        case Insecure = \"http\"\n+        case Secure = \"https\"\n+    }\n+\n+    enum URLComponent: String {\n+        case Blavatar = \"blavatar\"\n+        case Gravatar = \"avatar\"\n+    }\n+\n+    enum ImageURLQueryField: String {","path":"WordPress/Classes/Utility/ImageURLs/WPImageURLHelper.swift","position":23,"original_position":23,"commit_id":"113cb7256547a4d5d9d6e8c9a04846a5ca1eefb2","original_commit_id":"113cb7256547a4d5d9d6e8c9a04846a5ca1eefb2","user":{"login":"armcknight","id":3241469,"avatar_url":"https://avatars.githubusercontent.com/u/3241469?v=3","gravatar_id":"","url":"https://api.github.com/users/armcknight","html_url":"https://github.com/armcknight","followers_url":"https://api.github.com/users/armcknight/followers","following_url":"https://api.github.com/users/armcknight/following{/other_user}","gists_url":"https://api.github.com/users/armcknight/gists{/gist_id}","starred_url":"https://api.github.com/users/armcknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armcknight/subscriptions","organizations_url":"https://api.github.com/users/armcknight/orgs","repos_url":"https://api.github.com/users/armcknight/repos","events_url":"https://api.github.com/users/armcknight/events{/privacy}","received_events_url":"https://api.github.com/users/armcknight/received_events","type":"User","site_admin":false},"body":"Yeah, I went back and forth on this myself. I stuck with enum as it's the simplest way to model the concept (and most logical IMO–it's a finite set of possible values).","created_at":"2016-11-29T14:32:35Z","updated_at":"2016-11-29T14:32:35Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199#discussion_r90019255","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/90019255"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199#discussion_r90019255"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199","id":93888198,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/6199","number":6199,"state":"open","locked":false,"title":"Consolidate URL logic for images","user":{"login":"armcknight","id":3241469,"avatar_url":"https://avatars.githubusercontent.com/u/3241469?v=3","gravatar_id":"","url":"https://api.github.com/users/armcknight","html_url":"https://github.com/armcknight","followers_url":"https://api.github.com/users/armcknight/followers","following_url":"https://api.github.com/users/armcknight/following{/other_user}","gists_url":"https://api.github.com/users/armcknight/gists{/gist_id}","starred_url":"https://api.github.com/users/armcknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armcknight/subscriptions","organizations_url":"https://api.github.com/users/armcknight/orgs","repos_url":"https://api.github.com/users/armcknight/repos","events_url":"https://api.github.com/users/armcknight/events{/privacy}","received_events_url":"https://api.github.com/users/armcknight/received_events","type":"User","site_admin":false},"body":"Preparation to fix https://github.com/wordpress-mobile/WordPress-iOS/issues/904\r\n\r\nConsolidate the URL logic found in various places into `WPImageURLHelper`\r\n\r\nPhoton:\r\n\r\n- [x] `PhotonImageURLHelper`\r\n\r\nAvatars:\r\n\r\n- [x] `WPAvatarSource`\r\n- [x] `Gravatar.swift`\r\n- [x] `UIImageView+Gravatar`\r\n- [x] `UIImageView+Gravatar.swift`\r\n- [x] `ReaderPost`\r\n\r\nOther:\r\n\r\n- [x] `UIImageView+AFNetworkingExtra`\r\n- [x] `UIImageView+Extensions.swift`\r\n","created_at":"2016-11-16T02:03:57Z","updated_at":"2016-11-29T14:32:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a88802ce86950287067ef66c2c79e1a2e8eef627","assignee":{"login":"aerych","id":1435271,"avatar_url":"https://avatars.githubusercontent.com/u/1435271?v=3","gravatar_id":"","url":"https://api.github.com/users/aerych","html_url":"https://github.com/aerych","followers_url":"https://api.github.com/users/aerych/followers","following_url":"https://api.github.com/users/aerych/following{/other_user}","gists_url":"https://api.github.com/users/aerych/gists{/gist_id}","starred_url":"https://api.github.com/users/aerych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerych/subscriptions","organizations_url":"https://api.github.com/users/aerych/orgs","repos_url":"https://api.github.com/users/aerych/repos","events_url":"https://api.github.com/users/aerych/events{/privacy}","received_events_url":"https://api.github.com/users/aerych/received_events","type":"User","site_admin":false},"assignees":[{"login":"aerych","id":1435271,"avatar_url":"https://avatars.githubusercontent.com/u/1435271?v=3","gravatar_id":"","url":"https://api.github.com/users/aerych","html_url":"https://github.com/aerych","followers_url":"https://api.github.com/users/aerych/followers","following_url":"https://api.github.com/users/aerych/following{/other_user}","gists_url":"https://api.github.com/users/aerych/gists{/gist_id}","starred_url":"https://api.github.com/users/aerych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerych/subscriptions","organizations_url":"https://api.github.com/users/aerych/orgs","repos_url":"https://api.github.com/users/aerych/repos","events_url":"https://api.github.com/users/aerych/events{/privacy}","received_events_url":"https://api.github.com/users/aerych/received_events","type":"User","site_admin":false},{"login":"kurzee","id":1873422,"avatar_url":"https://avatars.githubusercontent.com/u/1873422?v=3","gravatar_id":"","url":"https://api.github.com/users/kurzee","html_url":"https://github.com/kurzee","followers_url":"https://api.github.com/users/kurzee/followers","following_url":"https://api.github.com/users/kurzee/following{/other_user}","gists_url":"https://api.github.com/users/kurzee/gists{/gist_id}","starred_url":"https://api.github.com/users/kurzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurzee/subscriptions","organizations_url":"https://api.github.com/users/kurzee/orgs","repos_url":"https://api.github.com/users/kurzee/repos","events_url":"https://api.github.com/users/kurzee/events{/privacy}","received_events_url":"https://api.github.com/users/kurzee/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/6199/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/113cb7256547a4d5d9d6e8c9a04846a5ca1eefb2","head":{"label":"armcknight:amcknight/url-builder","ref":"amcknight/url-builder","sha":"113cb7256547a4d5d9d6e8c9a04846a5ca1eefb2","user":{"login":"armcknight","id":3241469,"avatar_url":"https://avatars.githubusercontent.com/u/3241469?v=3","gravatar_id":"","url":"https://api.github.com/users/armcknight","html_url":"https://github.com/armcknight","followers_url":"https://api.github.com/users/armcknight/followers","following_url":"https://api.github.com/users/armcknight/following{/other_user}","gists_url":"https://api.github.com/users/armcknight/gists{/gist_id}","starred_url":"https://api.github.com/users/armcknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armcknight/subscriptions","organizations_url":"https://api.github.com/users/armcknight/orgs","repos_url":"https://api.github.com/users/armcknight/repos","events_url":"https://api.github.com/users/armcknight/events{/privacy}","received_events_url":"https://api.github.com/users/armcknight/received_events","type":"User","site_admin":false},"repo":{"id":72589852,"name":"WordPress-iOS","full_name":"armcknight/WordPress-iOS","owner":{"login":"armcknight","id":3241469,"avatar_url":"https://avatars.githubusercontent.com/u/3241469?v=3","gravatar_id":"","url":"https://api.github.com/users/armcknight","html_url":"https://github.com/armcknight","followers_url":"https://api.github.com/users/armcknight/followers","following_url":"https://api.github.com/users/armcknight/following{/other_user}","gists_url":"https://api.github.com/users/armcknight/gists{/gist_id}","starred_url":"https://api.github.com/users/armcknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armcknight/subscriptions","organizations_url":"https://api.github.com/users/armcknight/orgs","repos_url":"https://api.github.com/users/armcknight/repos","events_url":"https://api.github.com/users/armcknight/events{/privacy}","received_events_url":"https://api.github.com/users/armcknight/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/armcknight/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":true,"url":"https://api.github.com/repos/armcknight/WordPress-iOS","forks_url":"https://api.github.com/repos/armcknight/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/armcknight/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/armcknight/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/armcknight/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/armcknight/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/armcknight/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/armcknight/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/armcknight/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/armcknight/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/armcknight/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/armcknight/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/armcknight/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/armcknight/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/armcknight/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/armcknight/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/armcknight/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/armcknight/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/armcknight/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/armcknight/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/armcknight/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/armcknight/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/armcknight/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/armcknight/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/armcknight/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/armcknight/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/armcknight/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/armcknight/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/armcknight/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/armcknight/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/armcknight/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/armcknight/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/armcknight/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/armcknight/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/armcknight/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/armcknight/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/armcknight/WordPress-iOS/deployments","created_at":"2016-11-02T00:51:40Z","updated_at":"2016-11-02T00:51:48Z","pushed_at":"2016-11-29T04:37:50Z","git_url":"git://github.com/armcknight/WordPress-iOS.git","ssh_url":"git@github.com:armcknight/WordPress-iOS.git","clone_url":"https://github.com/armcknight/WordPress-iOS.git","svn_url":"https://github.com/armcknight/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":392484,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","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":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"f3bbbe90372cf16f14cf23c0e2929d1475dfc047","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/deployments","created_at":"2013-03-18T16:59:33Z","updated_at":"2016-11-29T07:16:54Z","pushed_at":"2016-11-29T13:33:53Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":517674,"stargazers_count":1623,"watchers_count":1623,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":629,"mirror_url":null,"open_issues_count":392,"forks":629,"open_issues":392,"watchers":1623,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/6199"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/6199"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/6199/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/6199/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/113cb7256547a4d5d9d6e8c9a04846a5ca1eefb2"}}}}
{"actor":{"display_login":"armcknight"}}