{"action":"created","comment":{"url":"https://api.github.com/repos/agazso/postmodern/pulls/comments/225104574","pull_request_review_id":164630033,"id":225104574,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTEwNDU3NA==","diff_hunk":"@@ -93,6 +113,63 @@ export const AsyncActions = {\n             dispatch(Actions.deletePost(post));\n         };\n     },\n+    sharePost: (post: Post) => {\n+        return async (dispatch, getState: () => AppState) => {\n+            const ownFeeds = getState().ownFeeds.toArray();\n+            if (ownFeeds.length > 0) {\n+                const feed = ownFeeds[0];\n+                if (post.link === feed.url) {\n+                    return;\n+                }\n+\n+                const localFeedPosts = getState().localPosts.toArray().filter(localPost =>\n+                    localPost.link === feed.url\n+                );\n+                const feedPosts = [...localFeedPosts, post];\n+                const posts = feedPosts\n+                    .sort((a, b) => b.createdAt - a.createdAt)\n+                    .slice(0, 20);\n+\n+                const postFeed = {\n+                    ...feed,\n+                    posts,\n+                };\n+                await updatePostFeed(postFeed);\n+                dispatch(Actions.updatePostLink(post, feed.url));\n+            } else {\n+                const author = getState().author.name;\n+                const favicon = getState().author.faviconUri;\n+                const feed = await createPostFeed(author, favicon, post);\n+\n+                dispatch(InternalActions.addOwnFeed(feed));\n+                dispatch(Actions.addFeed(feed));\n+                dispatch(Actions.updatePostLink(post, feed.url));\n+            }\n+\n+        };\n+    },\n+    chainActions: (thunks: ThunkTypes[], callback?: () => void) => {\n+        return async (dispatch, getState: () => AppState) => {\n+            for (const thunk of thunks) {\n+                if (isActionTypes(thunk)) {\n+                    dispatch(thunk);\n+                } else {\n+                    await thunk(dispatch, getState);\n+                }\n+            }\n+            if (callback != null) {\n+                callback();\n+            }\n+        };\n+    },\n+\n+};\n+\n+type Thunk = (dispatch: any, getState: () => AppState) => Promise<void>;","path":"src/actions/Actions.ts","position":135,"original_position":135,"commit_id":"b182a22d4dfdcfcba8274d008b3f1ce5a2a616ac","original_commit_id":"b182a22d4dfdcfcba8274d008b3f1ce5a2a616ac","user":{"login":"vujevits","id":2270661,"node_id":"MDQ6VXNlcjIyNzA2NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/2270661?v=4","gravatar_id":"","url":"https://api.github.com/users/vujevits","html_url":"https://github.com/vujevits","followers_url":"https://api.github.com/users/vujevits/followers","following_url":"https://api.github.com/users/vujevits/following{/other_user}","gists_url":"https://api.github.com/users/vujevits/gists{/gist_id}","starred_url":"https://api.github.com/users/vujevits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vujevits/subscriptions","organizations_url":"https://api.github.com/users/vujevits/orgs","repos_url":"https://api.github.com/users/vujevits/repos","events_url":"https://api.github.com/users/vujevits/events{/privacy}","received_events_url":"https://api.github.com/users/vujevits/received_events","type":"User","site_admin":false},"body":"great! ","created_at":"2018-10-15T09:57:04Z","updated_at":"2018-10-15T09:57:05Z","html_url":"https://github.com/agazso/postmodern/pull/10#discussion_r225104574","pull_request_url":"https://api.github.com/repos/agazso/postmodern/pulls/10","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/comments/225104574"},"html":{"href":"https://github.com/agazso/postmodern/pull/10#discussion_r225104574"},"pull_request":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/10"}},"in_reply_to_id":225063416},"pull_request":{"url":"https://api.github.com/repos/agazso/postmodern/pulls/10","id":222750940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNzUwOTQw","html_url":"https://github.com/agazso/postmodern/pull/10","diff_url":"https://github.com/agazso/postmodern/pull/10.diff","patch_url":"https://github.com/agazso/postmodern/pull/10.patch","issue_url":"https://api.github.com/repos/agazso/postmodern/issues/10","number":10,"state":"open","locked":false,"title":"Swarm sharing","user":{"login":"agazso","id":230163,"node_id":"MDQ6VXNlcjIzMDE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/230163?v=4","gravatar_id":"","url":"https://api.github.com/users/agazso","html_url":"https://github.com/agazso","followers_url":"https://api.github.com/users/agazso/followers","following_url":"https://api.github.com/users/agazso/following{/other_user}","gists_url":"https://api.github.com/users/agazso/gists{/gist_id}","starred_url":"https://api.github.com/users/agazso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agazso/subscriptions","organizations_url":"https://api.github.com/users/agazso/orgs","repos_url":"https://api.github.com/users/agazso/repos","events_url":"https://api.github.com/users/agazso/events{/privacy}","received_events_url":"https://api.github.com/users/agazso/received_events","type":"User","site_admin":false},"body":"Proof-of-Concept sharing over Swarm, MRU is mocked by primitive json-server based Hash Service.\r\n\r\nhttps://github.com/typicode/json-server\r\n\r\n","created_at":"2018-10-14T23:24:58Z","updated_at":"2018-10-15T09:57:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69ec6ef7650eb0633bcc20f04d073c0fdb3a7dbd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/agazso/postmodern/pulls/10/commits","review_comments_url":"https://api.github.com/repos/agazso/postmodern/pulls/10/comments","review_comment_url":"https://api.github.com/repos/agazso/postmodern/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agazso/postmodern/issues/10/comments","statuses_url":"https://api.github.com/repos/agazso/postmodern/statuses/b182a22d4dfdcfcba8274d008b3f1ce5a2a616ac","head":{"label":"agazso:swarm-sharing","ref":"swarm-sharing","sha":"b182a22d4dfdcfcba8274d008b3f1ce5a2a616ac","user":{"login":"agazso","id":230163,"node_id":"MDQ6VXNlcjIzMDE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/230163?v=4","gravatar_id":"","url":"https://api.github.com/users/agazso","html_url":"https://github.com/agazso","followers_url":"https://api.github.com/users/agazso/followers","following_url":"https://api.github.com/users/agazso/following{/other_user}","gists_url":"https://api.github.com/users/agazso/gists{/gist_id}","starred_url":"https://api.github.com/users/agazso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agazso/subscriptions","organizations_url":"https://api.github.com/users/agazso/orgs","repos_url":"https://api.github.com/users/agazso/repos","events_url":"https://api.github.com/users/agazso/events{/privacy}","received_events_url":"https://api.github.com/users/agazso/received_events","type":"User","site_admin":false},"repo":{"id":144973521,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ5NzM1MjE=","name":"postmodern","full_name":"agazso/postmodern","private":false,"owner":{"login":"agazso","id":230163,"node_id":"MDQ6VXNlcjIzMDE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/230163?v=4","gravatar_id":"","url":"https://api.github.com/users/agazso","html_url":"https://github.com/agazso","followers_url":"https://api.github.com/users/agazso/followers","following_url":"https://api.github.com/users/agazso/following{/other_user}","gists_url":"https://api.github.com/users/agazso/gists{/gist_id}","starred_url":"https://api.github.com/users/agazso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agazso/subscriptions","organizations_url":"https://api.github.com/users/agazso/orgs","repos_url":"https://api.github.com/users/agazso/repos","events_url":"https://api.github.com/users/agazso/events{/privacy}","received_events_url":"https://api.github.com/users/agazso/received_events","type":"User","site_admin":false},"html_url":"https://github.com/agazso/postmodern","description":null,"fork":false,"url":"https://api.github.com/repos/agazso/postmodern","forks_url":"https://api.github.com/repos/agazso/postmodern/forks","keys_url":"https://api.github.com/repos/agazso/postmodern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agazso/postmodern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agazso/postmodern/teams","hooks_url":"https://api.github.com/repos/agazso/postmodern/hooks","issue_events_url":"https://api.github.com/repos/agazso/postmodern/issues/events{/number}","events_url":"https://api.github.com/repos/agazso/postmodern/events","assignees_url":"https://api.github.com/repos/agazso/postmodern/assignees{/user}","branches_url":"https://api.github.com/repos/agazso/postmodern/branches{/branch}","tags_url":"https://api.github.com/repos/agazso/postmodern/tags","blobs_url":"https://api.github.com/repos/agazso/postmodern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agazso/postmodern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agazso/postmodern/git/refs{/sha}","trees_url":"https://api.github.com/repos/agazso/postmodern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agazso/postmodern/statuses/{sha}","languages_url":"https://api.github.com/repos/agazso/postmodern/languages","stargazers_url":"https://api.github.com/repos/agazso/postmodern/stargazers","contributors_url":"https://api.github.com/repos/agazso/postmodern/contributors","subscribers_url":"https://api.github.com/repos/agazso/postmodern/subscribers","subscription_url":"https://api.github.com/repos/agazso/postmodern/subscription","commits_url":"https://api.github.com/repos/agazso/postmodern/commits{/sha}","git_commits_url":"https://api.github.com/repos/agazso/postmodern/git/commits{/sha}","comments_url":"https://api.github.com/repos/agazso/postmodern/comments{/number}","issue_comment_url":"https://api.github.com/repos/agazso/postmodern/issues/comments{/number}","contents_url":"https://api.github.com/repos/agazso/postmodern/contents/{+path}","compare_url":"https://api.github.com/repos/agazso/postmodern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agazso/postmodern/merges","archive_url":"https://api.github.com/repos/agazso/postmodern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agazso/postmodern/downloads","issues_url":"https://api.github.com/repos/agazso/postmodern/issues{/number}","pulls_url":"https://api.github.com/repos/agazso/postmodern/pulls{/number}","milestones_url":"https://api.github.com/repos/agazso/postmodern/milestones{/number}","notifications_url":"https://api.github.com/repos/agazso/postmodern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agazso/postmodern/labels{/name}","releases_url":"https://api.github.com/repos/agazso/postmodern/releases{/id}","deployments_url":"https://api.github.com/repos/agazso/postmodern/deployments","created_at":"2018-08-16T10:32:25Z","updated_at":"2018-10-09T21:38:16Z","pushed_at":"2018-10-14T23:24:58Z","git_url":"git://github.com/agazso/postmodern.git","ssh_url":"git@github.com:agazso/postmodern.git","clone_url":"https://github.com/agazso/postmodern.git","svn_url":"https://github.com/agazso/postmodern","homepage":null,"size":1854,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"agazso:master","ref":"master","sha":"63ba003752337d6544753db86808dbb00d4a0e04","user":{"login":"agazso","id":230163,"node_id":"MDQ6VXNlcjIzMDE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/230163?v=4","gravatar_id":"","url":"https://api.github.com/users/agazso","html_url":"https://github.com/agazso","followers_url":"https://api.github.com/users/agazso/followers","following_url":"https://api.github.com/users/agazso/following{/other_user}","gists_url":"https://api.github.com/users/agazso/gists{/gist_id}","starred_url":"https://api.github.com/users/agazso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agazso/subscriptions","organizations_url":"https://api.github.com/users/agazso/orgs","repos_url":"https://api.github.com/users/agazso/repos","events_url":"https://api.github.com/users/agazso/events{/privacy}","received_events_url":"https://api.github.com/users/agazso/received_events","type":"User","site_admin":false},"repo":{"id":144973521,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ5NzM1MjE=","name":"postmodern","full_name":"agazso/postmodern","private":false,"owner":{"login":"agazso","id":230163,"node_id":"MDQ6VXNlcjIzMDE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/230163?v=4","gravatar_id":"","url":"https://api.github.com/users/agazso","html_url":"https://github.com/agazso","followers_url":"https://api.github.com/users/agazso/followers","following_url":"https://api.github.com/users/agazso/following{/other_user}","gists_url":"https://api.github.com/users/agazso/gists{/gist_id}","starred_url":"https://api.github.com/users/agazso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agazso/subscriptions","organizations_url":"https://api.github.com/users/agazso/orgs","repos_url":"https://api.github.com/users/agazso/repos","events_url":"https://api.github.com/users/agazso/events{/privacy}","received_events_url":"https://api.github.com/users/agazso/received_events","type":"User","site_admin":false},"html_url":"https://github.com/agazso/postmodern","description":null,"fork":false,"url":"https://api.github.com/repos/agazso/postmodern","forks_url":"https://api.github.com/repos/agazso/postmodern/forks","keys_url":"https://api.github.com/repos/agazso/postmodern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agazso/postmodern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agazso/postmodern/teams","hooks_url":"https://api.github.com/repos/agazso/postmodern/hooks","issue_events_url":"https://api.github.com/repos/agazso/postmodern/issues/events{/number}","events_url":"https://api.github.com/repos/agazso/postmodern/events","assignees_url":"https://api.github.com/repos/agazso/postmodern/assignees{/user}","branches_url":"https://api.github.com/repos/agazso/postmodern/branches{/branch}","tags_url":"https://api.github.com/repos/agazso/postmodern/tags","blobs_url":"https://api.github.com/repos/agazso/postmodern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agazso/postmodern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agazso/postmodern/git/refs{/sha}","trees_url":"https://api.github.com/repos/agazso/postmodern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agazso/postmodern/statuses/{sha}","languages_url":"https://api.github.com/repos/agazso/postmodern/languages","stargazers_url":"https://api.github.com/repos/agazso/postmodern/stargazers","contributors_url":"https://api.github.com/repos/agazso/postmodern/contributors","subscribers_url":"https://api.github.com/repos/agazso/postmodern/subscribers","subscription_url":"https://api.github.com/repos/agazso/postmodern/subscription","commits_url":"https://api.github.com/repos/agazso/postmodern/commits{/sha}","git_commits_url":"https://api.github.com/repos/agazso/postmodern/git/commits{/sha}","comments_url":"https://api.github.com/repos/agazso/postmodern/comments{/number}","issue_comment_url":"https://api.github.com/repos/agazso/postmodern/issues/comments{/number}","contents_url":"https://api.github.com/repos/agazso/postmodern/contents/{+path}","compare_url":"https://api.github.com/repos/agazso/postmodern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agazso/postmodern/merges","archive_url":"https://api.github.com/repos/agazso/postmodern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agazso/postmodern/downloads","issues_url":"https://api.github.com/repos/agazso/postmodern/issues{/number}","pulls_url":"https://api.github.com/repos/agazso/postmodern/pulls{/number}","milestones_url":"https://api.github.com/repos/agazso/postmodern/milestones{/number}","notifications_url":"https://api.github.com/repos/agazso/postmodern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agazso/postmodern/labels{/name}","releases_url":"https://api.github.com/repos/agazso/postmodern/releases{/id}","deployments_url":"https://api.github.com/repos/agazso/postmodern/deployments","created_at":"2018-08-16T10:32:25Z","updated_at":"2018-10-09T21:38:16Z","pushed_at":"2018-10-14T23:24:58Z","git_url":"git://github.com/agazso/postmodern.git","ssh_url":"git@github.com:agazso/postmodern.git","clone_url":"https://github.com/agazso/postmodern.git","svn_url":"https://github.com/agazso/postmodern","homepage":null,"size":1854,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/10"},"html":{"href":"https://github.com/agazso/postmodern/pull/10"},"issue":{"href":"https://api.github.com/repos/agazso/postmodern/issues/10"},"comments":{"href":"https://api.github.com/repos/agazso/postmodern/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agazso/postmodern/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/agazso/postmodern/statuses/b182a22d4dfdcfcba8274d008b3f1ce5a2a616ac"}},"author_association":"OWNER"}}
{"actor":{"display_login":"vujevits"}}