{"action":"created","comment":{"url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/comments/76416618","id":76416618,"diff_hunk":"@@ -0,0 +1,81 @@\n+package de.s3xy.architecturesample.github;\n+\n+import javax.inject.Inject;\n+import javax.inject.Named;\n+\n+import de.s3xy.architecturesample.github.model.RepositoriesSearchResult;\n+import de.s3xy.architecturesample.network.NetworkConnectivityManager;\n+import de.s3xy.architecturesample.network.NetworkModule;\n+import de.s3xy.architecturesample.network.NoNetworkException;\n+import rx.Observable;\n+\n+/**\n+ * Created by Vlad Fedorenko <vfedo92@gmail.com>\n+ * 08.26.2016\n+ */\n+public class GithubInteractor {\n+    private GithubApi mGithubAuthApi;\n+    private GithubApi mGithubApi;\n+    private GithubAuthManager mGithubAuthManager;\n+    private NetworkConnectivityManager mNetworkConnectivityManager;\n+\n+    @Inject\n+    GithubInteractor(@Named(NetworkModule.AUTH_FLOW) GithubApi githubAuthApi,\n+                     GithubApi api,\n+                     GithubAuthManager authManager,\n+                     NetworkConnectivityManager networkConnectivityManager) {\n+        mGithubAuthApi = githubAuthApi;\n+        mGithubApi = api;\n+        mGithubAuthManager = authManager;\n+        mNetworkConnectivityManager = networkConnectivityManager;\n+    }\n+\n+    public boolean shouldAuthorize() {\n+        return !mGithubAuthManager.shouldBeUnauthorized() && mGithubAuthManager.getAccessToken() == null;\n+    }\n+\n+    public Observable<Boolean> getAccessToken(String code) {\n+        if (!mNetworkConnectivityManager.isOnline()) {","path":"app/src/main/java/de/s3xy/architecturesample/github/GithubInteractor.java","position":38,"original_position":38,"commit_id":"63e1e63f6b278362ece7427ff2c24e19cff0b13a","original_commit_id":"63e1e63f6b278362ece7427ff2c24e19cff0b13a","user":{"login":"vfedorenko","id":1837446,"avatar_url":"https://avatars.githubusercontent.com/u/1837446?v=3","gravatar_id":"","url":"https://api.github.com/users/vfedorenko","html_url":"https://github.com/vfedorenko","followers_url":"https://api.github.com/users/vfedorenko/followers","following_url":"https://api.github.com/users/vfedorenko/following{/other_user}","gists_url":"https://api.github.com/users/vfedorenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vfedorenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfedorenko/subscriptions","organizations_url":"https://api.github.com/users/vfedorenko/orgs","repos_url":"https://api.github.com/users/vfedorenko/repos","events_url":"https://api.github.com/users/vfedorenko/events{/privacy}","received_events_url":"https://api.github.com/users/vfedorenko/received_events","type":"User","site_admin":false},"body":"You a right, I'll fix it. But I believe that flatMap is more suitable here, because we don't need inline code that compose provides, we should react to an item in the chain. Am I right?","created_at":"2016-08-26T13:18:50Z","updated_at":"2016-08-26T13:18:50Z","html_url":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3#discussion_r76416618","pull_request_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/comments/76416618"},"html":{"href":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3#discussion_r76416618"},"pull_request":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3","id":82867186,"html_url":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3","diff_url":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3.diff","patch_url":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3.patch","issue_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/3","number":3,"state":"open","locked":false,"title":"Feature/sign in","user":{"login":"andreycooper","id":2779412,"avatar_url":"https://avatars.githubusercontent.com/u/2779412?v=3","gravatar_id":"","url":"https://api.github.com/users/andreycooper","html_url":"https://github.com/andreycooper","followers_url":"https://api.github.com/users/andreycooper/followers","following_url":"https://api.github.com/users/andreycooper/following{/other_user}","gists_url":"https://api.github.com/users/andreycooper/gists{/gist_id}","starred_url":"https://api.github.com/users/andreycooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreycooper/subscriptions","organizations_url":"https://api.github.com/users/andreycooper/orgs","repos_url":"https://api.github.com/users/andreycooper/repos","events_url":"https://api.github.com/users/andreycooper/events{/privacy}","received_events_url":"https://api.github.com/users/andreycooper/received_events","type":"User","site_admin":false},"body":"It's better to use different scopes with Subcomponents :)","created_at":"2016-08-26T10:38:41Z","updated_at":"2016-08-26T13:18:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3ca3728fd9cca26bbcfbb49d50f3e0f962577fd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3/commits","review_comments_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3/comments","review_comment_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/comments{/number}","comments_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/3/comments","statuses_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/statuses/63e1e63f6b278362ece7427ff2c24e19cff0b13a","head":{"label":"andreycooper:feature/sign_in","ref":"feature/sign_in","sha":"63e1e63f6b278362ece7427ff2c24e19cff0b13a","user":{"login":"andreycooper","id":2779412,"avatar_url":"https://avatars.githubusercontent.com/u/2779412?v=3","gravatar_id":"","url":"https://api.github.com/users/andreycooper","html_url":"https://github.com/andreycooper","followers_url":"https://api.github.com/users/andreycooper/followers","following_url":"https://api.github.com/users/andreycooper/following{/other_user}","gists_url":"https://api.github.com/users/andreycooper/gists{/gist_id}","starred_url":"https://api.github.com/users/andreycooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreycooper/subscriptions","organizations_url":"https://api.github.com/users/andreycooper/orgs","repos_url":"https://api.github.com/users/andreycooper/repos","events_url":"https://api.github.com/users/andreycooper/events{/privacy}","received_events_url":"https://api.github.com/users/andreycooper/received_events","type":"User","site_admin":false},"repo":{"id":66537738,"name":"ArchitectureSample","full_name":"andreycooper/ArchitectureSample","owner":{"login":"andreycooper","id":2779412,"avatar_url":"https://avatars.githubusercontent.com/u/2779412?v=3","gravatar_id":"","url":"https://api.github.com/users/andreycooper","html_url":"https://github.com/andreycooper","followers_url":"https://api.github.com/users/andreycooper/followers","following_url":"https://api.github.com/users/andreycooper/following{/other_user}","gists_url":"https://api.github.com/users/andreycooper/gists{/gist_id}","starred_url":"https://api.github.com/users/andreycooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreycooper/subscriptions","organizations_url":"https://api.github.com/users/andreycooper/orgs","repos_url":"https://api.github.com/users/andreycooper/repos","events_url":"https://api.github.com/users/andreycooper/events{/privacy}","received_events_url":"https://api.github.com/users/andreycooper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreycooper/ArchitectureSample","description":"Sample Implementation of Application Architecture for Android.","fork":true,"url":"https://api.github.com/repos/andreycooper/ArchitectureSample","forks_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/forks","keys_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/teams","hooks_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/hooks","issue_events_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/issues/events{/number}","events_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/events","assignees_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/assignees{/user}","branches_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/branches{/branch}","tags_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/tags","blobs_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/statuses/{sha}","languages_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/languages","stargazers_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/stargazers","contributors_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/contributors","subscribers_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/subscribers","subscription_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/subscription","commits_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/contents/{+path}","compare_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/merges","archive_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/downloads","issues_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/issues{/number}","pulls_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/pulls{/number}","milestones_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/milestones{/number}","notifications_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/labels{/name}","releases_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/releases{/id}","deployments_url":"https://api.github.com/repos/andreycooper/ArchitectureSample/deployments","created_at":"2016-08-25T07:59:33Z","updated_at":"2016-08-25T07:59:35Z","pushed_at":"2016-08-26T10:28:00Z","git_url":"git://github.com/andreycooper/ArchitectureSample.git","ssh_url":"git@github.com:andreycooper/ArchitectureSample.git","clone_url":"https://github.com/andreycooper/ArchitectureSample.git","svn_url":"https://github.com/andreycooper/ArchitectureSample","homepage":null,"size":145,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"master"}},"base":{"label":"s3xy4ngyc:develop","ref":"develop","sha":"24fe509756d3c62934390e7237c2ee414e83b94a","user":{"login":"s3xy4ngyc","id":878307,"avatar_url":"https://avatars.githubusercontent.com/u/878307?v=3","gravatar_id":"","url":"https://api.github.com/users/s3xy4ngyc","html_url":"https://github.com/s3xy4ngyc","followers_url":"https://api.github.com/users/s3xy4ngyc/followers","following_url":"https://api.github.com/users/s3xy4ngyc/following{/other_user}","gists_url":"https://api.github.com/users/s3xy4ngyc/gists{/gist_id}","starred_url":"https://api.github.com/users/s3xy4ngyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s3xy4ngyc/subscriptions","organizations_url":"https://api.github.com/users/s3xy4ngyc/orgs","repos_url":"https://api.github.com/users/s3xy4ngyc/repos","events_url":"https://api.github.com/users/s3xy4ngyc/events{/privacy}","received_events_url":"https://api.github.com/users/s3xy4ngyc/received_events","type":"User","site_admin":false},"repo":{"id":64689611,"name":"ArchitectureSample","full_name":"s3xy4ngyc/ArchitectureSample","owner":{"login":"s3xy4ngyc","id":878307,"avatar_url":"https://avatars.githubusercontent.com/u/878307?v=3","gravatar_id":"","url":"https://api.github.com/users/s3xy4ngyc","html_url":"https://github.com/s3xy4ngyc","followers_url":"https://api.github.com/users/s3xy4ngyc/followers","following_url":"https://api.github.com/users/s3xy4ngyc/following{/other_user}","gists_url":"https://api.github.com/users/s3xy4ngyc/gists{/gist_id}","starred_url":"https://api.github.com/users/s3xy4ngyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s3xy4ngyc/subscriptions","organizations_url":"https://api.github.com/users/s3xy4ngyc/orgs","repos_url":"https://api.github.com/users/s3xy4ngyc/repos","events_url":"https://api.github.com/users/s3xy4ngyc/events{/privacy}","received_events_url":"https://api.github.com/users/s3xy4ngyc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s3xy4ngyc/ArchitectureSample","description":"Sample Implementation of Application Architecture for Android.","fork":false,"url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample","forks_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/forks","keys_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/teams","hooks_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/hooks","issue_events_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/events{/number}","events_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/events","assignees_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/assignees{/user}","branches_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/branches{/branch}","tags_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/tags","blobs_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/git/refs{/sha}","trees_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/statuses/{sha}","languages_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/languages","stargazers_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/stargazers","contributors_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/contributors","subscribers_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/subscribers","subscription_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/subscription","commits_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/commits{/sha}","git_commits_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/git/commits{/sha}","comments_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/comments{/number}","issue_comment_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/comments{/number}","contents_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/contents/{+path}","compare_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/merges","archive_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/downloads","issues_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues{/number}","pulls_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls{/number}","milestones_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/milestones{/number}","notifications_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/labels{/name}","releases_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/releases{/id}","deployments_url":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/deployments","created_at":"2016-08-01T18:01:20Z","updated_at":"2016-08-01T18:02:25Z","pushed_at":"2016-08-26T10:38:41Z","git_url":"git://github.com/s3xy4ngyc/ArchitectureSample.git","ssh_url":"git@github.com:s3xy4ngyc/ArchitectureSample.git","clone_url":"https://github.com/s3xy4ngyc/ArchitectureSample.git","svn_url":"https://github.com/s3xy4ngyc/ArchitectureSample","homepage":null,"size":115,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3"},"html":{"href":"https://github.com/s3xy4ngyc/ArchitectureSample/pull/3"},"issue":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/3"},"comments":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/s3xy4ngyc/ArchitectureSample/statuses/63e1e63f6b278362ece7427ff2c24e19cff0b13a"}}}}
{"actor":{"display_login":"vfedorenko"}}