{"action":"created","comment":{"url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments/37461279","id":37461279,"diff_hunk":"@@ -559,3 +561,19 @@ bool TabSupervisor::getAdminLocked() const\n         return true;\n     return tabAdmin->getLocked();\n }\n+\n+void TabSupervisor::processNotifyUserEvent(const Event_NotifyUser &event)\n+{\n+    QString notificationTitle(\"Notification\");\n+    QString notificationMessage;\n+    switch ((Event_NotifyUser::NotificationType) event.type()) {\n+        case Event_NotifyUser::PROMOTIONSUCCESS: QMessageBox::information(this, tr(\"Success\"), tr(\"Successfully promoted user.\")); break;","path":"cockatrice/src/tab_supervisor.cpp","position":41,"original_position":41,"commit_id":"d82f80b1540bf692f562388cbf91229506ad23de","original_commit_id":"d82f80b1540bf692f562388cbf91229506ad23de","user":{"login":"Daenyth","id":14644,"avatar_url":"https://avatars.githubusercontent.com/u/14644?v=3","gravatar_id":"","url":"https://api.github.com/users/Daenyth","html_url":"https://github.com/Daenyth","followers_url":"https://api.github.com/users/Daenyth/followers","following_url":"https://api.github.com/users/Daenyth/following{/other_user}","gists_url":"https://api.github.com/users/Daenyth/gists{/gist_id}","starred_url":"https://api.github.com/users/Daenyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daenyth/subscriptions","organizations_url":"https://api.github.com/users/Daenyth/orgs","repos_url":"https://api.github.com/users/Daenyth/repos","events_url":"https://api.github.com/users/Daenyth/events{/privacy}","received_events_url":"https://api.github.com/users/Daenyth/received_events","type":"User","site_admin":false},"body":"This isn't the right use for this. This data should be contained in the `Response` to the promotion action.\r\n\r\nLook at the pr for adding registration protocol if you want an example of how to add new responses with commands.","created_at":"2015-08-19T20:07:19Z","updated_at":"2015-08-19T20:07:19Z","html_url":"https://github.com/Cockatrice/Cockatrice/pull/1391#discussion_r37461279","pull_request_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391","_links":{"self":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments/37461279"},"html":{"href":"https://github.com/Cockatrice/Cockatrice/pull/1391#discussion_r37461279"},"pull_request":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391"}}},"pull_request":{"url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391","id":42856841,"html_url":"https://github.com/Cockatrice/Cockatrice/pull/1391","diff_url":"https://github.com/Cockatrice/Cockatrice/pull/1391.diff","patch_url":"https://github.com/Cockatrice/Cockatrice/pull/1391.patch","issue_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1391","number":1391,"state":"open","locked":false,"title":"Allows admins to promote users to mod and demote mod to user","user":{"login":"woogerboy21","id":1361287,"avatar_url":"https://avatars.githubusercontent.com/u/1361287?v=3","gravatar_id":"","url":"https://api.github.com/users/woogerboy21","html_url":"https://github.com/woogerboy21","followers_url":"https://api.github.com/users/woogerboy21/followers","following_url":"https://api.github.com/users/woogerboy21/following{/other_user}","gists_url":"https://api.github.com/users/woogerboy21/gists{/gist_id}","starred_url":"https://api.github.com/users/woogerboy21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woogerboy21/subscriptions","organizations_url":"https://api.github.com/users/woogerboy21/orgs","repos_url":"https://api.github.com/users/woogerboy21/repos","events_url":"https://api.github.com/users/woogerboy21/events{/privacy}","received_events_url":"https://api.github.com/users/woogerboy21/received_events","type":"User","site_admin":false},"body":"Fix #1377 \r\n\r\nThis PR adds the ability for administrators to promote a user to admin status, or demote a moderator to user status.  A new right click context menu item has been added when a moderator right clicks on the username from the user list (as long as the admin tools are  unlocked).\r\n\r\nThings to point out about this change.\r\n* A extension to the session event protocol has been put in place.\r\n* Right click menu option evaluates users current position and only adds promote or demote\r\n* When a user is promoted, the user is sent a notification about so mentioning they need to log out / in\r\n* When a mod is demoted, the moderator is immediately removed from the server.\r\n* Admin performing the command always gets notified of the commands results (success/fail)\r\n* The new event notifications logic has been put in place to also accommodate #190.\r\n\r\n(Items not pictured are the context menu items and failure popup boxes if the commands fail.)\r\n\r\nEdit:\r\nPlease ignore the commit message, it mis-states \"moderators to promote\".  It should read \"Admins to promote\".  Moderators do not get the menu options and the new menu items are located in the processExtendedAdminCommands function.","created_at":"2015-08-19T19:56:33Z","updated_at":"2015-08-19T20:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1dd4f94a964f670116f7c7f9962fe9e951ab4bca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391/commits","review_comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391/comments","review_comment_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1391/comments","statuses_url":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/d82f80b1540bf692f562388cbf91229506ad23de","head":{"label":"woogerboy21:admin_adjustmods","ref":"admin_adjustmods","sha":"d82f80b1540bf692f562388cbf91229506ad23de","user":{"login":"woogerboy21","id":1361287,"avatar_url":"https://avatars.githubusercontent.com/u/1361287?v=3","gravatar_id":"","url":"https://api.github.com/users/woogerboy21","html_url":"https://github.com/woogerboy21","followers_url":"https://api.github.com/users/woogerboy21/followers","following_url":"https://api.github.com/users/woogerboy21/following{/other_user}","gists_url":"https://api.github.com/users/woogerboy21/gists{/gist_id}","starred_url":"https://api.github.com/users/woogerboy21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woogerboy21/subscriptions","organizations_url":"https://api.github.com/users/woogerboy21/orgs","repos_url":"https://api.github.com/users/woogerboy21/repos","events_url":"https://api.github.com/users/woogerboy21/events{/privacy}","received_events_url":"https://api.github.com/users/woogerboy21/received_events","type":"User","site_admin":false},"repo":{"id":21113338,"name":"Cockatrice","full_name":"woogerboy21/Cockatrice","owner":{"login":"woogerboy21","id":1361287,"avatar_url":"https://avatars.githubusercontent.com/u/1361287?v=3","gravatar_id":"","url":"https://api.github.com/users/woogerboy21","html_url":"https://github.com/woogerboy21","followers_url":"https://api.github.com/users/woogerboy21/followers","following_url":"https://api.github.com/users/woogerboy21/following{/other_user}","gists_url":"https://api.github.com/users/woogerboy21/gists{/gist_id}","starred_url":"https://api.github.com/users/woogerboy21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woogerboy21/subscriptions","organizations_url":"https://api.github.com/users/woogerboy21/orgs","repos_url":"https://api.github.com/users/woogerboy21/repos","events_url":"https://api.github.com/users/woogerboy21/events{/privacy}","received_events_url":"https://api.github.com/users/woogerboy21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/woogerboy21/Cockatrice","description":"A cross-platform virtual tabletop for multiplayer card games","fork":true,"url":"https://api.github.com/repos/woogerboy21/Cockatrice","forks_url":"https://api.github.com/repos/woogerboy21/Cockatrice/forks","keys_url":"https://api.github.com/repos/woogerboy21/Cockatrice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woogerboy21/Cockatrice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woogerboy21/Cockatrice/teams","hooks_url":"https://api.github.com/repos/woogerboy21/Cockatrice/hooks","issue_events_url":"https://api.github.com/repos/woogerboy21/Cockatrice/issues/events{/number}","events_url":"https://api.github.com/repos/woogerboy21/Cockatrice/events","assignees_url":"https://api.github.com/repos/woogerboy21/Cockatrice/assignees{/user}","branches_url":"https://api.github.com/repos/woogerboy21/Cockatrice/branches{/branch}","tags_url":"https://api.github.com/repos/woogerboy21/Cockatrice/tags","blobs_url":"https://api.github.com/repos/woogerboy21/Cockatrice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woogerboy21/Cockatrice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woogerboy21/Cockatrice/git/refs{/sha}","trees_url":"https://api.github.com/repos/woogerboy21/Cockatrice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woogerboy21/Cockatrice/statuses/{sha}","languages_url":"https://api.github.com/repos/woogerboy21/Cockatrice/languages","stargazers_url":"https://api.github.com/repos/woogerboy21/Cockatrice/stargazers","contributors_url":"https://api.github.com/repos/woogerboy21/Cockatrice/contributors","subscribers_url":"https://api.github.com/repos/woogerboy21/Cockatrice/subscribers","subscription_url":"https://api.github.com/repos/woogerboy21/Cockatrice/subscription","commits_url":"https://api.github.com/repos/woogerboy21/Cockatrice/commits{/sha}","git_commits_url":"https://api.github.com/repos/woogerboy21/Cockatrice/git/commits{/sha}","comments_url":"https://api.github.com/repos/woogerboy21/Cockatrice/comments{/number}","issue_comment_url":"https://api.github.com/repos/woogerboy21/Cockatrice/issues/comments{/number}","contents_url":"https://api.github.com/repos/woogerboy21/Cockatrice/contents/{+path}","compare_url":"https://api.github.com/repos/woogerboy21/Cockatrice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woogerboy21/Cockatrice/merges","archive_url":"https://api.github.com/repos/woogerboy21/Cockatrice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woogerboy21/Cockatrice/downloads","issues_url":"https://api.github.com/repos/woogerboy21/Cockatrice/issues{/number}","pulls_url":"https://api.github.com/repos/woogerboy21/Cockatrice/pulls{/number}","milestones_url":"https://api.github.com/repos/woogerboy21/Cockatrice/milestones{/number}","notifications_url":"https://api.github.com/repos/woogerboy21/Cockatrice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woogerboy21/Cockatrice/labels{/name}","releases_url":"https://api.github.com/repos/woogerboy21/Cockatrice/releases{/id}","created_at":"2014-06-23T03:52:32Z","updated_at":"2015-03-06T17:12:51Z","pushed_at":"2015-08-19T19:44:09Z","git_url":"git://github.com/woogerboy21/Cockatrice.git","ssh_url":"git@github.com:woogerboy21/Cockatrice.git","clone_url":"https://github.com/woogerboy21/Cockatrice.git","svn_url":"https://github.com/woogerboy21/Cockatrice","homepage":"","size":30928,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"Cockatrice:master","ref":"master","sha":"1ef90418159646180cae497682e3404bd2ccccf5","user":{"login":"Cockatrice","id":9746249,"avatar_url":"https://avatars.githubusercontent.com/u/9746249?v=3","gravatar_id":"","url":"https://api.github.com/users/Cockatrice","html_url":"https://github.com/Cockatrice","followers_url":"https://api.github.com/users/Cockatrice/followers","following_url":"https://api.github.com/users/Cockatrice/following{/other_user}","gists_url":"https://api.github.com/users/Cockatrice/gists{/gist_id}","starred_url":"https://api.github.com/users/Cockatrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cockatrice/subscriptions","organizations_url":"https://api.github.com/users/Cockatrice/orgs","repos_url":"https://api.github.com/users/Cockatrice/repos","events_url":"https://api.github.com/users/Cockatrice/events{/privacy}","received_events_url":"https://api.github.com/users/Cockatrice/received_events","type":"Organization","site_admin":false},"repo":{"id":2907031,"name":"Cockatrice","full_name":"Cockatrice/Cockatrice","owner":{"login":"Cockatrice","id":9746249,"avatar_url":"https://avatars.githubusercontent.com/u/9746249?v=3","gravatar_id":"","url":"https://api.github.com/users/Cockatrice","html_url":"https://github.com/Cockatrice","followers_url":"https://api.github.com/users/Cockatrice/followers","following_url":"https://api.github.com/users/Cockatrice/following{/other_user}","gists_url":"https://api.github.com/users/Cockatrice/gists{/gist_id}","starred_url":"https://api.github.com/users/Cockatrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cockatrice/subscriptions","organizations_url":"https://api.github.com/users/Cockatrice/orgs","repos_url":"https://api.github.com/users/Cockatrice/repos","events_url":"https://api.github.com/users/Cockatrice/events{/privacy}","received_events_url":"https://api.github.com/users/Cockatrice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cockatrice/Cockatrice","description":"A cross-platform virtual tabletop for multiplayer card games","fork":false,"url":"https://api.github.com/repos/Cockatrice/Cockatrice","forks_url":"https://api.github.com/repos/Cockatrice/Cockatrice/forks","keys_url":"https://api.github.com/repos/Cockatrice/Cockatrice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cockatrice/Cockatrice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cockatrice/Cockatrice/teams","hooks_url":"https://api.github.com/repos/Cockatrice/Cockatrice/hooks","issue_events_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/events{/number}","events_url":"https://api.github.com/repos/Cockatrice/Cockatrice/events","assignees_url":"https://api.github.com/repos/Cockatrice/Cockatrice/assignees{/user}","branches_url":"https://api.github.com/repos/Cockatrice/Cockatrice/branches{/branch}","tags_url":"https://api.github.com/repos/Cockatrice/Cockatrice/tags","blobs_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/{sha}","languages_url":"https://api.github.com/repos/Cockatrice/Cockatrice/languages","stargazers_url":"https://api.github.com/repos/Cockatrice/Cockatrice/stargazers","contributors_url":"https://api.github.com/repos/Cockatrice/Cockatrice/contributors","subscribers_url":"https://api.github.com/repos/Cockatrice/Cockatrice/subscribers","subscription_url":"https://api.github.com/repos/Cockatrice/Cockatrice/subscription","commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cockatrice/Cockatrice/contents/{+path}","compare_url":"https://api.github.com/repos/Cockatrice/Cockatrice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cockatrice/Cockatrice/merges","archive_url":"https://api.github.com/repos/Cockatrice/Cockatrice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cockatrice/Cockatrice/downloads","issues_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues{/number}","pulls_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls{/number}","milestones_url":"https://api.github.com/repos/Cockatrice/Cockatrice/milestones{/number}","notifications_url":"https://api.github.com/repos/Cockatrice/Cockatrice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cockatrice/Cockatrice/labels{/name}","releases_url":"https://api.github.com/repos/Cockatrice/Cockatrice/releases{/id}","created_at":"2011-12-03T20:58:09Z","updated_at":"2015-08-18T23:29:45Z","pushed_at":"2015-08-19T19:56:34Z","git_url":"git://github.com/Cockatrice/Cockatrice.git","ssh_url":"git@github.com:Cockatrice/Cockatrice.git","clone_url":"https://github.com/Cockatrice/Cockatrice.git","svn_url":"https://github.com/Cockatrice/Cockatrice","homepage":"","size":42631,"stargazers_count":303,"watchers_count":303,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":221,"forks":188,"open_issues":221,"watchers":303,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391"},"html":{"href":"https://github.com/Cockatrice/Cockatrice/pull/1391"},"issue":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1391"},"comments":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1391/comments"},"review_comments":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391/comments"},"review_comment":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1391/commits"},"statuses":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/d82f80b1540bf692f562388cbf91229506ad23de"}}}}