{"action":"created","comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/66488095","id":66488095,"diff_hunk":"@@ -0,0 +1,73 @@\n+class LivechatInquiry extends RocketChat.models._Base {\n+\tconstructor() {\n+\t\tsuper();\n+\t\tthis._initModel('livechat_inquiry');\n+\n+\t\tthis.tryEnsureIndex({ 'rid': 1 }); // room id corresponding to this inquiry \n+\t\tthis.tryEnsureIndex({ 'name': 1 }); // name of the inquiry (client name for now)\n+\t\tthis.tryEnsureIndex({ 'message': 1 }); // message sent by the client \n+\t\tthis.tryEnsureIndex({ 'ts': 1 }); // timestamp\n+\t\tthis.tryEnsureIndex({ 'code': 1 }); // (for routing)\n+\t\tthis.tryEnsureIndex({ 'agents': 1}); // Id's of the agents who can see the inquiry (handle departments)\n+\t\tthis.tryEnsureIndex({ 'status': 1}); // 'open', 'taken'\n+\t}\n+\n+\t/*\n+\t * User with uid takes the inquiry\n+\t * subsribe user to room, remove inquiry from collection \n+\t */\n+\ttakeInquiry(inquiry, agent) {\n+\n+\t\t// add subscription\n+\t\tvar subscriptionData = {\n+\t\t\trid: inquiry.rid,\n+\t\t\tname: inquiry.name,\n+\t\t\talert: true,\n+\t\t\topen: true,\n+\t\t\tunread: 1,\n+\t\t\tcode: inquiry.code,\n+\t\t\tu: {\n+\t\t\t\t_id: agent._id,\n+\t\t\t\tusername: agent.username\n+\t\t\t},\n+\t\t\tt: 'l',\n+\t\t\tdesktopNotifications: 'all',\n+\t\t\tmobilePushNotifications: 'all',\n+\t\t\temailNotifications: 'all',\n+\t\t\tanswered: 'false',\n+\t\t\t// assignment: 'view'\n+\t\t};\n+\t\tRocketChat.models.Subscriptions.insert(subscriptionData);\n+\n+\t\t// add user to room \n+\t\tRocketChat.models.Rooms.addUsernameById(inquiry.rid, agent.username);\n+\n+\t\t// TODO: mark inquiry as taken \n+\t\tthis.update({},{ \n+\t\t\t$set: { status: 'taken' } \n+\t\t});\n+\n+\t\t// add status field \n+\t\t// this.remove({_id: inquiry._id});\t","path":"packages/rocketchat-livechat/server/models/LivechatInquiry.js","position":51,"original_position":51,"commit_id":"922a39ce0ef8004fabecf31dc623412e5754e956","original_commit_id":"922a39ce0ef8004fabecf31dc623412e5754e956","user":{"login":"rodrigok","id":234261,"avatar_url":"https://avatars.githubusercontent.com/u/234261?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigok","html_url":"https://github.com/rodrigok","followers_url":"https://api.github.com/users/rodrigok/followers","following_url":"https://api.github.com/users/rodrigok/following{/other_user}","gists_url":"https://api.github.com/users/rodrigok/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigok/subscriptions","organizations_url":"https://api.github.com/users/rodrigok/orgs","repos_url":"https://api.github.com/users/rodrigok/repos","events_url":"https://api.github.com/users/rodrigok/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigok/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Trailing spaces not allowed.](https://www.codacy.com/app/RocketChat/Rocket-Chat/file/2726404280/issues/source?bid=3199634&fileBranchId=3348698#l51)","created_at":"2016-06-09T17:48:05Z","updated_at":"2016-06-09T17:48:05Z","html_url":"https://github.com/RocketChat/Rocket.Chat/pull/3507#discussion_r66488095","pull_request_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507","_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/66488095"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/3507#discussion_r66488095"},"pull_request":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507"}}},"pull_request":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507","id":73256159,"html_url":"https://github.com/RocketChat/Rocket.Chat/pull/3507","diff_url":"https://github.com/RocketChat/Rocket.Chat/pull/3507.diff","patch_url":"https://github.com/RocketChat/Rocket.Chat/pull/3507.patch","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3507","number":3507,"state":"open","locked":false,"title":"Livechat queue methods options & Guest Pool queue method","user":{"login":"AlecTroemel","id":8620042,"avatar_url":"https://avatars.githubusercontent.com/u/8620042?v=3","gravatar_id":"","url":"https://api.github.com/users/AlecTroemel","html_url":"https://github.com/AlecTroemel","followers_url":"https://api.github.com/users/AlecTroemel/followers","following_url":"https://api.github.com/users/AlecTroemel/following{/other_user}","gists_url":"https://api.github.com/users/AlecTroemel/gists{/gist_id}","starred_url":"https://api.github.com/users/AlecTroemel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlecTroemel/subscriptions","organizations_url":"https://api.github.com/users/AlecTroemel/orgs","repos_url":"https://api.github.com/users/AlecTroemel/repos","events_url":"https://api.github.com/users/AlecTroemel/events{/privacy}","received_events_url":"https://api.github.com/users/AlecTroemel/received_events","type":"User","site_admin":false},"body":"@RocketChat/core \r\n\r\nCloses #3433 \r\n\r\nAdded option to choose between multiple live chat queuing methods. The old way is now the \"least amount\" \r\n\r\nAlso added another method called \"Guest Pool\" where agents take clients from open inquiries within your departments. \r\n<img width=\"687\" alt=\"screen shot 2016-06-09 at 12 35 52 pm\" src=\"https://cloud.githubusercontent.com/assets/8620042/15939955/9e9d9e66-2e3f-11e6-9ec9-9567966e3978.png\">\r\n<img width=\"259\" alt=\"screen shot 2016-06-09 at 12 36 48 pm\" src=\"https://cloud.githubusercontent.com/assets/8620042/15939957/a10bb994-2e3f-11e6-81ff-9b5c96046137.png\">\r\n<img width=\"768\" alt=\"screen shot 2016-06-09 at 12 37 03 pm\" src=\"https://cloud.githubusercontent.com/assets/8620042/15939960/a31a5b64-2e3f-11e6-9a99-f375b66e6a9d.png\">\r\n<img width=\"928\" alt=\"screen shot 2016-06-09 at 12 37 15 pm\" src=\"https://cloud.githubusercontent.com/assets/8620042/15939976/ae2bfd3c-2e3f-11e6-8bce-3cf5500b77c5.png\">\r\n\r\n","created_at":"2016-06-09T17:44:50Z","updated_at":"2016-06-09T17:48:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37bf68c0fec115605c093de2a3d1e1539571979f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507/commits","review_comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507/comments","review_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3507/comments","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/922a39ce0ef8004fabecf31dc623412e5754e956","head":{"label":"AlecTroemel:develop","ref":"develop","sha":"922a39ce0ef8004fabecf31dc623412e5754e956","user":{"login":"AlecTroemel","id":8620042,"avatar_url":"https://avatars.githubusercontent.com/u/8620042?v=3","gravatar_id":"","url":"https://api.github.com/users/AlecTroemel","html_url":"https://github.com/AlecTroemel","followers_url":"https://api.github.com/users/AlecTroemel/followers","following_url":"https://api.github.com/users/AlecTroemel/following{/other_user}","gists_url":"https://api.github.com/users/AlecTroemel/gists{/gist_id}","starred_url":"https://api.github.com/users/AlecTroemel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlecTroemel/subscriptions","organizations_url":"https://api.github.com/users/AlecTroemel/orgs","repos_url":"https://api.github.com/users/AlecTroemel/repos","events_url":"https://api.github.com/users/AlecTroemel/events{/privacy}","received_events_url":"https://api.github.com/users/AlecTroemel/received_events","type":"User","site_admin":false},"repo":{"id":60197306,"name":"Rocket.Chat","full_name":"AlecTroemel/Rocket.Chat","owner":{"login":"AlecTroemel","id":8620042,"avatar_url":"https://avatars.githubusercontent.com/u/8620042?v=3","gravatar_id":"","url":"https://api.github.com/users/AlecTroemel","html_url":"https://github.com/AlecTroemel","followers_url":"https://api.github.com/users/AlecTroemel/followers","following_url":"https://api.github.com/users/AlecTroemel/following{/other_user}","gists_url":"https://api.github.com/users/AlecTroemel/gists{/gist_id}","starred_url":"https://api.github.com/users/AlecTroemel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlecTroemel/subscriptions","organizations_url":"https://api.github.com/users/AlecTroemel/orgs","repos_url":"https://api.github.com/users/AlecTroemel/repos","events_url":"https://api.github.com/users/AlecTroemel/events{/privacy}","received_events_url":"https://api.github.com/users/AlecTroemel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlecTroemel/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":true,"url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat","forks_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/AlecTroemel/Rocket.Chat/deployments","created_at":"2016-06-01T17:27:56Z","updated_at":"2016-06-09T15:33:46Z","pushed_at":"2016-06-09T17:15:44Z","git_url":"git://github.com/AlecTroemel/Rocket.Chat.git","ssh_url":"git@github.com:AlecTroemel/Rocket.Chat.git","clone_url":"https://github.com/AlecTroemel/Rocket.Chat.git","svn_url":"https://github.com/AlecTroemel/Rocket.Chat","homepage":"https://rocket.chat/","size":36873,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"RocketChat:develop","ref":"develop","sha":"a2ba8cb08f4735a7182e69b49649598d065fcb96","user":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"repo":{"id":35866694,"name":"Rocket.Chat","full_name":"RocketChat/Rocket.Chat","owner":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketChat/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":false,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat","forks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/deployments","created_at":"2015-05-19T07:36:09Z","updated_at":"2016-06-09T17:46:22Z","pushed_at":"2016-06-09T17:44:50Z","git_url":"git://github.com/RocketChat/Rocket.Chat.git","ssh_url":"git@github.com:RocketChat/Rocket.Chat.git","clone_url":"https://github.com/RocketChat/Rocket.Chat.git","svn_url":"https://github.com/RocketChat/Rocket.Chat","homepage":"https://rocket.chat/","size":50002,"stargazers_count":7418,"watchers_count":7418,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1549,"mirror_url":null,"open_issues_count":852,"forks":1549,"open_issues":852,"watchers":7418,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/3507"},"issue":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3507"},"comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3507/comments"},"review_comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507/comments"},"review_comment":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3507/commits"},"statuses":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/922a39ce0ef8004fabecf31dc623412e5754e956"}}}}
{"actor":{"display_login":"rodrigok"}}