{"action":"closed","number":17,"pull_request":{"url":"https://api.github.com/repos/iiegor/xat-server/pulls/17","id":57760009,"html_url":"https://github.com/iiegor/xat-server/pull/17","diff_url":"https://github.com/iiegor/xat-server/pull/17.diff","patch_url":"https://github.com/iiegor/xat-server/pull/17.patch","issue_url":"https://api.github.com/repos/iiegor/xat-server/issues/17","number":17,"state":"closed","locked":false,"title":"30.01.16-31.01.16 changelist","user":{"login":"HuuMaNoID","id":3264579,"avatar_url":"https://avatars.githubusercontent.com/u/3264579?v=3","gravatar_id":"","url":"https://api.github.com/users/HuuMaNoID","html_url":"https://github.com/HuuMaNoID","followers_url":"https://api.github.com/users/HuuMaNoID/followers","following_url":"https://api.github.com/users/HuuMaNoID/following{/other_user}","gists_url":"https://api.github.com/users/HuuMaNoID/gists{/gist_id}","starred_url":"https://api.github.com/users/HuuMaNoID/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuuMaNoID/subscriptions","organizations_url":"https://api.github.com/users/HuuMaNoID/orgs","repos_url":"https://api.github.com/users/HuuMaNoID/repos","events_url":"https://api.github.com/users/HuuMaNoID/events{/privacy}","received_events_url":"https://api.github.com/users/HuuMaNoID/received_events","type":"User","site_admin":false},"body":"Time to discuss.\r\n\r\n## Changes:\r\n## 1. Private message handling. \r\nThe difference between my and your version that my version dispatch both 'z' and 'p' packets.\r\nIt seems that your version contains bug. What if global.Server.getClientById(toID) is undefined? Use \r\n```coffee\r\nglobal.Server.getClientById(toID)? \r\n```\r\ninstead.\r\nQuestion: are we need to emit 'z' private message packages at all? I think it's ok if we renounce 'z' or 'p' package. 'z' packages is more preferable it's format is more clear. Look at the formats in all cases:\r\n\\<p u=\"FROM-USER_ID\" t=\"MESSAGE\" [s=\"2\" d=\"FROM-USER_ID\"] /> - user receives\r\n\\<p u=\"TO-USER_ID\" t=\"MESSAGE\" /> - user sends (pm)\r\n\\<p u=\"TO-USER_ID\" t=\"MESSAGE\" s=\"2\" d=\"FROM-USER_ID\" > - user sends (pc)\r\n \\<z u=\"FROM-USER_ID\" t=\"MESSAGE\" [s=\"2\"] d=\"TO-USER_ID\" /> - user receives and sends\r\n\r\n## 2. Multichat\r\nNow user can log in several chats. I suggest new Server scheme\r\n![img](http://i.imgur.com/8p7Qd1j.png)\r\nIt's clear about rooms, what do clients array means now? Clients array points to id's handlers, which are latest active. For example:\r\nmy id is 1337 and i'm connected to chats 15 and 700\r\ni've posted a message in 15. So, my last active chat is 15 and clients[1337] should points to handler with chat == 15\r\nand then i've tickled user at chat 700. Now my latest active chat is 700 and clients[1337] should points to handler with chat == 700\r\nI'm going to implement private message routing soon.\r\n\r\n## 3. Prepared statements.\r\nIn current realisation, sql injections are possible (and it's easy to perform them)\r\nFor example: use userno = \"123' OR '1'>'2\" to log in as user with id 123\r\nPrepared statements helps to avoid this situation. That's it!\r\n\r\n## 4. Dup fix? \r\nWe can use my or your version, i think it doesn't matter.","created_at":"2016-01-31T05:04:44Z","updated_at":"2016-01-31T19:00:29Z","closed_at":"2016-01-31T19:00:29Z","merged_at":"2016-01-31T19:00:29Z","merge_commit_sha":"7cf91608f63dae61e0af8b969939b0e91f6c7d71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iiegor/xat-server/pulls/17/commits","review_comments_url":"https://api.github.com/repos/iiegor/xat-server/pulls/17/comments","review_comment_url":"https://api.github.com/repos/iiegor/xat-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iiegor/xat-server/issues/17/comments","statuses_url":"https://api.github.com/repos/iiegor/xat-server/statuses/d5f261295a6d846a79cec45c13b20625ca971b10","head":{"label":"HuuMaNoID:master","ref":"master","sha":"d5f261295a6d846a79cec45c13b20625ca971b10","user":{"login":"HuuMaNoID","id":3264579,"avatar_url":"https://avatars.githubusercontent.com/u/3264579?v=3","gravatar_id":"","url":"https://api.github.com/users/HuuMaNoID","html_url":"https://github.com/HuuMaNoID","followers_url":"https://api.github.com/users/HuuMaNoID/followers","following_url":"https://api.github.com/users/HuuMaNoID/following{/other_user}","gists_url":"https://api.github.com/users/HuuMaNoID/gists{/gist_id}","starred_url":"https://api.github.com/users/HuuMaNoID/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuuMaNoID/subscriptions","organizations_url":"https://api.github.com/users/HuuMaNoID/orgs","repos_url":"https://api.github.com/users/HuuMaNoID/repos","events_url":"https://api.github.com/users/HuuMaNoID/events{/privacy}","received_events_url":"https://api.github.com/users/HuuMaNoID/received_events","type":"User","site_admin":false},"repo":{"id":49766783,"name":"xat-server","full_name":"HuuMaNoID/xat-server","owner":{"login":"HuuMaNoID","id":3264579,"avatar_url":"https://avatars.githubusercontent.com/u/3264579?v=3","gravatar_id":"","url":"https://api.github.com/users/HuuMaNoID","html_url":"https://github.com/HuuMaNoID","followers_url":"https://api.github.com/users/HuuMaNoID/followers","following_url":"https://api.github.com/users/HuuMaNoID/following{/other_user}","gists_url":"https://api.github.com/users/HuuMaNoID/gists{/gist_id}","starred_url":"https://api.github.com/users/HuuMaNoID/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuuMaNoID/subscriptions","organizations_url":"https://api.github.com/users/HuuMaNoID/orgs","repos_url":"https://api.github.com/users/HuuMaNoID/repos","events_url":"https://api.github.com/users/HuuMaNoID/events{/privacy}","received_events_url":"https://api.github.com/users/HuuMaNoID/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HuuMaNoID/xat-server","description":"A Node.js private server of xat.com","fork":true,"url":"https://api.github.com/repos/HuuMaNoID/xat-server","forks_url":"https://api.github.com/repos/HuuMaNoID/xat-server/forks","keys_url":"https://api.github.com/repos/HuuMaNoID/xat-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HuuMaNoID/xat-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HuuMaNoID/xat-server/teams","hooks_url":"https://api.github.com/repos/HuuMaNoID/xat-server/hooks","issue_events_url":"https://api.github.com/repos/HuuMaNoID/xat-server/issues/events{/number}","events_url":"https://api.github.com/repos/HuuMaNoID/xat-server/events","assignees_url":"https://api.github.com/repos/HuuMaNoID/xat-server/assignees{/user}","branches_url":"https://api.github.com/repos/HuuMaNoID/xat-server/branches{/branch}","tags_url":"https://api.github.com/repos/HuuMaNoID/xat-server/tags","blobs_url":"https://api.github.com/repos/HuuMaNoID/xat-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HuuMaNoID/xat-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HuuMaNoID/xat-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/HuuMaNoID/xat-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HuuMaNoID/xat-server/statuses/{sha}","languages_url":"https://api.github.com/repos/HuuMaNoID/xat-server/languages","stargazers_url":"https://api.github.com/repos/HuuMaNoID/xat-server/stargazers","contributors_url":"https://api.github.com/repos/HuuMaNoID/xat-server/contributors","subscribers_url":"https://api.github.com/repos/HuuMaNoID/xat-server/subscribers","subscription_url":"https://api.github.com/repos/HuuMaNoID/xat-server/subscription","commits_url":"https://api.github.com/repos/HuuMaNoID/xat-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/HuuMaNoID/xat-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/HuuMaNoID/xat-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/HuuMaNoID/xat-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/HuuMaNoID/xat-server/contents/{+path}","compare_url":"https://api.github.com/repos/HuuMaNoID/xat-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HuuMaNoID/xat-server/merges","archive_url":"https://api.github.com/repos/HuuMaNoID/xat-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HuuMaNoID/xat-server/downloads","issues_url":"https://api.github.com/repos/HuuMaNoID/xat-server/issues{/number}","pulls_url":"https://api.github.com/repos/HuuMaNoID/xat-server/pulls{/number}","milestones_url":"https://api.github.com/repos/HuuMaNoID/xat-server/milestones{/number}","notifications_url":"https://api.github.com/repos/HuuMaNoID/xat-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HuuMaNoID/xat-server/labels{/name}","releases_url":"https://api.github.com/repos/HuuMaNoID/xat-server/releases{/id}","deployments_url":"https://api.github.com/repos/HuuMaNoID/xat-server/deployments","created_at":"2016-01-16T09:06:20Z","updated_at":"2016-01-30T20:15:35Z","pushed_at":"2016-01-31T18:41:49Z","git_url":"git://github.com/HuuMaNoID/xat-server.git","ssh_url":"git@github.com:HuuMaNoID/xat-server.git","clone_url":"https://github.com/HuuMaNoID/xat-server.git","svn_url":"https://github.com/HuuMaNoID/xat-server","homepage":"","size":181,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"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":"iiegor:master","ref":"master","sha":"bf69c54ec8c91b7d3d9b3a05f887672c5f3e1e72","user":{"login":"iiegor","id":3694005,"avatar_url":"https://avatars.githubusercontent.com/u/3694005?v=3","gravatar_id":"","url":"https://api.github.com/users/iiegor","html_url":"https://github.com/iiegor","followers_url":"https://api.github.com/users/iiegor/followers","following_url":"https://api.github.com/users/iiegor/following{/other_user}","gists_url":"https://api.github.com/users/iiegor/gists{/gist_id}","starred_url":"https://api.github.com/users/iiegor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iiegor/subscriptions","organizations_url":"https://api.github.com/users/iiegor/orgs","repos_url":"https://api.github.com/users/iiegor/repos","events_url":"https://api.github.com/users/iiegor/events{/privacy}","received_events_url":"https://api.github.com/users/iiegor/received_events","type":"User","site_admin":false},"repo":{"id":25786188,"name":"xat-server","full_name":"iiegor/xat-server","owner":{"login":"iiegor","id":3694005,"avatar_url":"https://avatars.githubusercontent.com/u/3694005?v=3","gravatar_id":"","url":"https://api.github.com/users/iiegor","html_url":"https://github.com/iiegor","followers_url":"https://api.github.com/users/iiegor/followers","following_url":"https://api.github.com/users/iiegor/following{/other_user}","gists_url":"https://api.github.com/users/iiegor/gists{/gist_id}","starred_url":"https://api.github.com/users/iiegor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iiegor/subscriptions","organizations_url":"https://api.github.com/users/iiegor/orgs","repos_url":"https://api.github.com/users/iiegor/repos","events_url":"https://api.github.com/users/iiegor/events{/privacy}","received_events_url":"https://api.github.com/users/iiegor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iiegor/xat-server","description":"A Node.js private server of xat.com","fork":false,"url":"https://api.github.com/repos/iiegor/xat-server","forks_url":"https://api.github.com/repos/iiegor/xat-server/forks","keys_url":"https://api.github.com/repos/iiegor/xat-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iiegor/xat-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iiegor/xat-server/teams","hooks_url":"https://api.github.com/repos/iiegor/xat-server/hooks","issue_events_url":"https://api.github.com/repos/iiegor/xat-server/issues/events{/number}","events_url":"https://api.github.com/repos/iiegor/xat-server/events","assignees_url":"https://api.github.com/repos/iiegor/xat-server/assignees{/user}","branches_url":"https://api.github.com/repos/iiegor/xat-server/branches{/branch}","tags_url":"https://api.github.com/repos/iiegor/xat-server/tags","blobs_url":"https://api.github.com/repos/iiegor/xat-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iiegor/xat-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iiegor/xat-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/iiegor/xat-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iiegor/xat-server/statuses/{sha}","languages_url":"https://api.github.com/repos/iiegor/xat-server/languages","stargazers_url":"https://api.github.com/repos/iiegor/xat-server/stargazers","contributors_url":"https://api.github.com/repos/iiegor/xat-server/contributors","subscribers_url":"https://api.github.com/repos/iiegor/xat-server/subscribers","subscription_url":"https://api.github.com/repos/iiegor/xat-server/subscription","commits_url":"https://api.github.com/repos/iiegor/xat-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/iiegor/xat-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/iiegor/xat-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/iiegor/xat-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/iiegor/xat-server/contents/{+path}","compare_url":"https://api.github.com/repos/iiegor/xat-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iiegor/xat-server/merges","archive_url":"https://api.github.com/repos/iiegor/xat-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iiegor/xat-server/downloads","issues_url":"https://api.github.com/repos/iiegor/xat-server/issues{/number}","pulls_url":"https://api.github.com/repos/iiegor/xat-server/pulls{/number}","milestones_url":"https://api.github.com/repos/iiegor/xat-server/milestones{/number}","notifications_url":"https://api.github.com/repos/iiegor/xat-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iiegor/xat-server/labels{/name}","releases_url":"https://api.github.com/repos/iiegor/xat-server/releases{/id}","deployments_url":"https://api.github.com/repos/iiegor/xat-server/deployments","created_at":"2014-10-26T18:46:03Z","updated_at":"2016-01-30T05:32:17Z","pushed_at":"2016-01-31T19:00:29Z","git_url":"git://github.com/iiegor/xat-server.git","ssh_url":"git@github.com:iiegor/xat-server.git","clone_url":"https://github.com/iiegor/xat-server.git","svn_url":"https://github.com/iiegor/xat-server","homepage":"","size":180,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iiegor/xat-server/pulls/17"},"html":{"href":"https://github.com/iiegor/xat-server/pull/17"},"issue":{"href":"https://api.github.com/repos/iiegor/xat-server/issues/17"},"comments":{"href":"https://api.github.com/repos/iiegor/xat-server/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/iiegor/xat-server/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/iiegor/xat-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iiegor/xat-server/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/iiegor/xat-server/statuses/d5f261295a6d846a79cec45c13b20625ca971b10"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"iiegor","id":3694005,"avatar_url":"https://avatars.githubusercontent.com/u/3694005?v=3","gravatar_id":"","url":"https://api.github.com/users/iiegor","html_url":"https://github.com/iiegor","followers_url":"https://api.github.com/users/iiegor/followers","following_url":"https://api.github.com/users/iiegor/following{/other_user}","gists_url":"https://api.github.com/users/iiegor/gists{/gist_id}","starred_url":"https://api.github.com/users/iiegor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iiegor/subscriptions","organizations_url":"https://api.github.com/users/iiegor/orgs","repos_url":"https://api.github.com/users/iiegor/repos","events_url":"https://api.github.com/users/iiegor/events{/privacy}","received_events_url":"https://api.github.com/users/iiegor/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":12,"additions":122,"deletions":93,"changed_files":6}}