{"action":"created","comment":{"url":"https://api.github.com/repos/status-im/status-react/pulls/comments/200031282","pull_request_review_id":134263227,"id":200031282,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDAzMTI4Mg==","diff_hunk":"@@ -0,0 +1,139 @@\n+(ns status-im.chat.commands.core\n+  (:require-macros [status-im.utils.views :refer [defview letsubs]])\n+  (:require [re-frame.core :as re-frame]\n+            [status-im.ui.components.react :as react]\n+            [status-im.ui.components.icons.vector-icons :as vector-icons]\n+            [status-im.ui.components.colors :as colors]\n+            [status-im.i18n :as i18n]\n+            [status-im.chat.styles.message.message :as style]))\n+\n+(defprotocol Command\n+  \"Protocol for defining command message behaviour\"\n+  (id [this] \"Identifier of the command, used to look-up command display name as well\")\n+  (scope [this]\n+    \"Scope of the command, defined as set of values representing contexts\n+     where in which command is available, together with `id` it forms unique\n+     identifier for each command.\n+     Available values for the set are: \n+     `id-of-the-any-chat` - command if available only for the specified chat\n+     `:personal-chats` - command is available for any personal 1-1 chat\n+     `:group-chats` - command is available for any group chat\n+     `:public-chats` - command is available for any public chat\n+     `:requested` - command is available only when there is an outstanding request\")\n+  (parameters [this]\n+    \"Ordered sequence of command parameter templates, where each parameter \n+     is defined as map consisting of mandatory `:id`, `:title` and `:type` keys, \n+     and optional `:suggestions` field.\n+     When used, `:suggestions` containes reference to any generic helper component\n+     rendering suggestions for the argument (input code will handle when and where\n+     to render it)\")\n+  (validate [this parameters cofx]\n+    \"Function validating the parameters once command is send. Takes parameters map\n+    and `cofx` map as argument, returns either `nil` meaning that no errors were\n+    found and command send workflow can proceed, or sequence of errors to display\")\n+  (on-send [this message-id parameters cofx]\n+    \"Function which can provide any extra effects to be produced in addition to \n+    normal message effects which happen whenever message is sent\")\n+  (short-preview [this command-message]","path":"src/status_im/chat/commands/core.cljs","position":37,"original_position":37,"commit_id":"40479042268bbca108e100db5cbf4dfb5739d567","original_commit_id":"40479042268bbca108e100db5cbf4dfb5739d567","user":{"login":"goranjovic","id":711764,"node_id":"MDQ6VXNlcjcxMTc2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/711764?v=4","gravatar_id":"","url":"https://api.github.com/users/goranjovic","html_url":"https://github.com/goranjovic","followers_url":"https://api.github.com/users/goranjovic/followers","following_url":"https://api.github.com/users/goranjovic/following{/other_user}","gists_url":"https://api.github.com/users/goranjovic/gists{/gist_id}","starred_url":"https://api.github.com/users/goranjovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goranjovic/subscriptions","organizations_url":"https://api.github.com/users/goranjovic/orgs","repos_url":"https://api.github.com/users/goranjovic/repos","events_url":"https://api.github.com/users/goranjovic/events{/privacy}","received_events_url":"https://api.github.com/users/goranjovic/received_events","type":"User","site_admin":false},"body":"On a less related topic, can we take this opportunity to rename `preview` and `short-preview` to something more appropriate? The current names make no sense - a preview is something you see before, not after the message is sent.","created_at":"2018-07-04T07:30:34Z","updated_at":"2018-07-04T07:49:18Z","html_url":"https://github.com/status-im/status-react/pull/5039#discussion_r200031282","pull_request_url":"https://api.github.com/repos/status-im/status-react/pulls/5039","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/status-im/status-react/pulls/comments/200031282"},"html":{"href":"https://github.com/status-im/status-react/pull/5039#discussion_r200031282"},"pull_request":{"href":"https://api.github.com/repos/status-im/status-react/pulls/5039"}},"in_reply_to_id":199867211},"pull_request":{"url":"https://api.github.com/repos/status-im/status-react/pulls/5039","id":199005647,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MDA1NjQ3","html_url":"https://github.com/status-im/status-react/pull/5039","diff_url":"https://github.com/status-im/status-react/pull/5039.diff","patch_url":"https://github.com/status-im/status-react/pull/5039.patch","issue_url":"https://api.github.com/repos/status-im/status-react/issues/5039","number":5039,"state":"open","locked":false,"title":"Cljs commands proposal","user":{"login":"janherich","id":1910609,"node_id":"MDQ6VXNlcjE5MTA2MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false},"body":"[comment]: # (Please replace ... with your information. Remove < and >)\r\n[comment]: # (To auto-close issue on merge, please insert the related issue number after # i.e fixes #566)\r\n\r\nThis PR features proposal of the new `Command` protocol for expressing command messages in clojurescript, not using `Jail` cells anymore. Please have a good look at the protocol and example implementation of the `/send` command, so we can flesh-it out now, before it's actually hooked into the send flow.\r\nWhen implemented, it will massively simplify all the input/send handling, getting rid of all hardcoded paths + making implementing new commands a breeze. \r\nI think the protocol with method docstrings is pretty self explanatory, but don't hesitate to raise any questions now. \r\n\r\n### Steps to test:\r\nNothing to test for now\r\n\r\nstatus: ready\r\n","created_at":"2018-07-03T15:39:19Z","updated_at":"2018-07-04T07:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34983f3368e49b1704864db83146b1b2a7ec4923","assignee":{"login":"janherich","id":1910609,"node_id":"MDQ6VXNlcjE5MTA2MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false},"assignees":[{"login":"janherich","id":1910609,"node_id":"MDQ6VXNlcjE5MTA2MDk=","avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"rasom","id":2364994,"node_id":"MDQ6VXNlcjIzNjQ5OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2364994?v=4","gravatar_id":"","url":"https://api.github.com/users/rasom","html_url":"https://github.com/rasom","followers_url":"https://api.github.com/users/rasom/followers","following_url":"https://api.github.com/users/rasom/following{/other_user}","gists_url":"https://api.github.com/users/rasom/gists{/gist_id}","starred_url":"https://api.github.com/users/rasom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasom/subscriptions","organizations_url":"https://api.github.com/users/rasom/orgs","repos_url":"https://api.github.com/users/rasom/repos","events_url":"https://api.github.com/users/rasom/events{/privacy}","received_events_url":"https://api.github.com/users/rasom/received_events","type":"User","site_admin":false},{"login":"flexsurfer","id":11790366,"node_id":"MDQ6VXNlcjExNzkwMzY2","avatar_url":"https://avatars1.githubusercontent.com/u/11790366?v=4","gravatar_id":"","url":"https://api.github.com/users/flexsurfer","html_url":"https://github.com/flexsurfer","followers_url":"https://api.github.com/users/flexsurfer/followers","following_url":"https://api.github.com/users/flexsurfer/following{/other_user}","gists_url":"https://api.github.com/users/flexsurfer/gists{/gist_id}","starred_url":"https://api.github.com/users/flexsurfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flexsurfer/subscriptions","organizations_url":"https://api.github.com/users/flexsurfer/orgs","repos_url":"https://api.github.com/users/flexsurfer/repos","events_url":"https://api.github.com/users/flexsurfer/events{/privacy}","received_events_url":"https://api.github.com/users/flexsurfer/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":948263151,"node_id":"MDU6TGFiZWw5NDgyNjMxNTE=","url":"https://api.github.com/repos/status-im/status-react/labels/skip-manual-qa","name":"skip-manual-qa","color":"FF8C00","default":false},{"id":692308696,"node_id":"MDU6TGFiZWw2OTIzMDg2OTY=","url":"https://api.github.com/repos/status-im/status-react/labels/tech-debt","name":"tech-debt","color":"e99695","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/status-im/status-react/pulls/5039/commits","review_comments_url":"https://api.github.com/repos/status-im/status-react/pulls/5039/comments","review_comment_url":"https://api.github.com/repos/status-im/status-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/status-im/status-react/issues/5039/comments","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/40479042268bbca108e100db5cbf4dfb5739d567","head":{"label":"status-im:feature/cljs-commands","ref":"feature/cljs-commands","sha":"40479042268bbca108e100db5cbf4dfb5739d567","user":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":52308441,"node_id":"MDEwOlJlcG9zaXRvcnk1MjMwODQ0MQ==","name":"status-react","full_name":"status-im/status-react","owner":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/status-im/status-react","description":"a free (libre) open source, mobile OS for Ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-react","forks_url":"https://api.github.com/repos/status-im/status-react/forks","keys_url":"https://api.github.com/repos/status-im/status-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-react/teams","hooks_url":"https://api.github.com/repos/status-im/status-react/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-react/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-react/events","assignees_url":"https://api.github.com/repos/status-im/status-react/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-react/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-react/tags","blobs_url":"https://api.github.com/repos/status-im/status-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-react/languages","stargazers_url":"https://api.github.com/repos/status-im/status-react/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-react/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-react/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-react/subscription","commits_url":"https://api.github.com/repos/status-im/status-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-react/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-react/merges","archive_url":"https://api.github.com/repos/status-im/status-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-react/downloads","issues_url":"https://api.github.com/repos/status-im/status-react/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-react/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-react/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-react/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-react/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-react/deployments","created_at":"2016-02-22T21:48:48Z","updated_at":"2018-07-04T04:07:29Z","pushed_at":"2018-07-04T07:03:40Z","git_url":"git://github.com/status-im/status-react.git","ssh_url":"git@github.com:status-im/status-react.git","clone_url":"https://github.com/status-im/status-react.git","svn_url":"https://github.com/status-im/status-react","homepage":"https://status.im","size":57135,"stargazers_count":2306,"watchers_count":2306,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":566,"mirror_url":null,"archived":false,"open_issues_count":698,"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":566,"open_issues":698,"watchers":2306,"default_branch":"develop"}},"base":{"label":"status-im:develop","ref":"develop","sha":"ee317c4aeb83a23a62274a90955258598ab86ef9","user":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":52308441,"node_id":"MDEwOlJlcG9zaXRvcnk1MjMwODQ0MQ==","name":"status-react","full_name":"status-im/status-react","owner":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/status-im/status-react","description":"a free (libre) open source, mobile OS for Ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-react","forks_url":"https://api.github.com/repos/status-im/status-react/forks","keys_url":"https://api.github.com/repos/status-im/status-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-react/teams","hooks_url":"https://api.github.com/repos/status-im/status-react/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-react/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-react/events","assignees_url":"https://api.github.com/repos/status-im/status-react/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-react/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-react/tags","blobs_url":"https://api.github.com/repos/status-im/status-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-react/languages","stargazers_url":"https://api.github.com/repos/status-im/status-react/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-react/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-react/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-react/subscription","commits_url":"https://api.github.com/repos/status-im/status-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-react/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-react/merges","archive_url":"https://api.github.com/repos/status-im/status-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-react/downloads","issues_url":"https://api.github.com/repos/status-im/status-react/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-react/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-react/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-react/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-react/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-react/deployments","created_at":"2016-02-22T21:48:48Z","updated_at":"2018-07-04T04:07:29Z","pushed_at":"2018-07-04T07:03:40Z","git_url":"git://github.com/status-im/status-react.git","ssh_url":"git@github.com:status-im/status-react.git","clone_url":"https://github.com/status-im/status-react.git","svn_url":"https://github.com/status-im/status-react","homepage":"https://status.im","size":57135,"stargazers_count":2306,"watchers_count":2306,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":566,"mirror_url":null,"archived":false,"open_issues_count":698,"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":566,"open_issues":698,"watchers":2306,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/status-im/status-react/pulls/5039"},"html":{"href":"https://github.com/status-im/status-react/pull/5039"},"issue":{"href":"https://api.github.com/repos/status-im/status-react/issues/5039"},"comments":{"href":"https://api.github.com/repos/status-im/status-react/issues/5039/comments"},"review_comments":{"href":"https://api.github.com/repos/status-im/status-react/pulls/5039/comments"},"review_comment":{"href":"https://api.github.com/repos/status-im/status-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/status-im/status-react/pulls/5039/commits"},"statuses":{"href":"https://api.github.com/repos/status-im/status-react/statuses/40479042268bbca108e100db5cbf4dfb5739d567"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"goranjovic"}}