{"action":"created","comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/179936705","pull_request_review_id":110276050,"id":179936705,"diff_hunk":"@@ -115,12 +112,20 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)\n     if (GetLastError() != ERROR_SUCCESS)\n         return;\n \n-    if (action == ShutdownDialogAction::Suspend)\n-        SetSuspendState(false, false, false);\n-    else if (action == ShutdownDialogAction::Hibernate)\n-        SetSuspendState(true, false, false);\n-    else\n+    using PSETSUSPENDSTATE = BOOLEAN (WINAPI *)(BOOLEAN, BOOLEAN, BOOLEAN);\n+    const auto setSuspendState = Utils::Misc::loadAPI<PSETSUSPENDSTATE>(\"PowrProf.dll\", \"SetSuspendState\");\n+\n+    if (action == ShutdownDialogAction::Suspend) {\n+        if (setSuspendState)\n+            setSuspendState(false, false, false);\n+    }\n+    else if (action == ShutdownDialogAction::Hibernate) {\n+        if (setSuspendState)\n+            setSuspendState(true, false, false);\n+    }\n+    else {\n         InitiateSystemShutdownA(0, QCoreApplication::translate(\"misc\", \"qBittorrent will shutdown the computer now because all downloads are complete.\").toLocal8Bit().data(), 10, true, false);","path":"src/base/utils/misc.cpp","position":null,"original_position":118,"commit_id":"76d55dabcf6cc60160b9e9f50dc948aa61d9dcdb","original_commit_id":"4d0c3aa6238f3f1dc47fbff284982234cc962fe6","user":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","gravatar_id":"","url":"https://api.github.com/users/glassez","html_url":"https://github.com/glassez","followers_url":"https://api.github.com/users/glassez/followers","following_url":"https://api.github.com/users/glassez/following{/other_user}","gists_url":"https://api.github.com/users/glassez/gists{/gist_id}","starred_url":"https://api.github.com/users/glassez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glassez/subscriptions","organizations_url":"https://api.github.com/users/glassez/orgs","repos_url":"https://api.github.com/users/glassez/repos","events_url":"https://api.github.com/users/glassez/events{/privacy}","received_events_url":"https://api.github.com/users/glassez/received_events","type":"User","site_admin":false},"body":"It's still unchanged...","created_at":"2018-04-08T06:16:30Z","updated_at":"2018-04-08T06:16:30Z","html_url":"https://github.com/qbittorrent/qBittorrent/pull/8699#discussion_r179936705","pull_request_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/179936705"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/8699#discussion_r179936705"},"pull_request":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699"}},"in_reply_to_id":179915704},"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699","id":180095567,"html_url":"https://github.com/qbittorrent/qBittorrent/pull/8699","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/8699.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/8699.patch","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8699","number":8699,"state":"open","locked":false,"title":"Add helper for loading windows system functions","user":{"login":"Chocobo1","id":9395168,"avatar_url":"https://avatars2.githubusercontent.com/u/9395168?v=4","gravatar_id":"","url":"https://api.github.com/users/Chocobo1","html_url":"https://github.com/Chocobo1","followers_url":"https://api.github.com/users/Chocobo1/followers","following_url":"https://api.github.com/users/Chocobo1/following{/other_user}","gists_url":"https://api.github.com/users/Chocobo1/gists{/gist_id}","starred_url":"https://api.github.com/users/Chocobo1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chocobo1/subscriptions","organizations_url":"https://api.github.com/users/Chocobo1/orgs","repos_url":"https://api.github.com/users/Chocobo1/repos","events_url":"https://api.github.com/users/Chocobo1/events{/privacy}","received_events_url":"https://api.github.com/users/Chocobo1/received_events","type":"User","site_admin":false},"body":"The dlls should be loaded from windows\\system32 explicitly, otherwise it poses a security risk.","created_at":"2018-04-07T08:18:58Z","updated_at":"2018-04-08T06:16:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f1423bc502c2fd301deaef979f637066468cab7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/44","html_url":"https://github.com/qbittorrent/qBittorrent/milestone/44","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/44/labels","id":3058182,"number":44,"title":"4.0.5","description":null,"creator":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","gravatar_id":"","url":"https://api.github.com/users/glassez","html_url":"https://github.com/glassez","followers_url":"https://api.github.com/users/glassez/followers","following_url":"https://api.github.com/users/glassez/following{/other_user}","gists_url":"https://api.github.com/users/glassez/gists{/gist_id}","starred_url":"https://api.github.com/users/glassez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glassez/subscriptions","organizations_url":"https://api.github.com/users/glassez/orgs","repos_url":"https://api.github.com/users/glassez/repos","events_url":"https://api.github.com/users/glassez/events{/privacy}","received_events_url":"https://api.github.com/users/glassez/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":41,"state":"open","created_at":"2018-01-23T17:05:19Z","updated_at":"2018-04-08T05:28:15Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699/commits","review_comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699/comments","review_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8699/comments","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/76d55dabcf6cc60160b9e9f50dc948aa61d9dcdb","head":{"label":"Chocobo1:linking","ref":"linking","sha":"76d55dabcf6cc60160b9e9f50dc948aa61d9dcdb","user":{"login":"Chocobo1","id":9395168,"avatar_url":"https://avatars2.githubusercontent.com/u/9395168?v=4","gravatar_id":"","url":"https://api.github.com/users/Chocobo1","html_url":"https://github.com/Chocobo1","followers_url":"https://api.github.com/users/Chocobo1/followers","following_url":"https://api.github.com/users/Chocobo1/following{/other_user}","gists_url":"https://api.github.com/users/Chocobo1/gists{/gist_id}","starred_url":"https://api.github.com/users/Chocobo1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chocobo1/subscriptions","organizations_url":"https://api.github.com/users/Chocobo1/orgs","repos_url":"https://api.github.com/users/Chocobo1/repos","events_url":"https://api.github.com/users/Chocobo1/events{/privacy}","received_events_url":"https://api.github.com/users/Chocobo1/received_events","type":"User","site_admin":false},"repo":{"id":30459428,"name":"qBittorrent","full_name":"Chocobo1/qBittorrent","owner":{"login":"Chocobo1","id":9395168,"avatar_url":"https://avatars2.githubusercontent.com/u/9395168?v=4","gravatar_id":"","url":"https://api.github.com/users/Chocobo1","html_url":"https://github.com/Chocobo1","followers_url":"https://api.github.com/users/Chocobo1/followers","following_url":"https://api.github.com/users/Chocobo1/following{/other_user}","gists_url":"https://api.github.com/users/Chocobo1/gists{/gist_id}","starred_url":"https://api.github.com/users/Chocobo1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chocobo1/subscriptions","organizations_url":"https://api.github.com/users/Chocobo1/orgs","repos_url":"https://api.github.com/users/Chocobo1/repos","events_url":"https://api.github.com/users/Chocobo1/events{/privacy}","received_events_url":"https://api.github.com/users/Chocobo1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Chocobo1/qBittorrent","description":"qBittorrent BitTorrent client","fork":true,"url":"https://api.github.com/repos/Chocobo1/qBittorrent","forks_url":"https://api.github.com/repos/Chocobo1/qBittorrent/forks","keys_url":"https://api.github.com/repos/Chocobo1/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chocobo1/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chocobo1/qBittorrent/teams","hooks_url":"https://api.github.com/repos/Chocobo1/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/Chocobo1/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/Chocobo1/qBittorrent/events","assignees_url":"https://api.github.com/repos/Chocobo1/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/Chocobo1/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/Chocobo1/qBittorrent/tags","blobs_url":"https://api.github.com/repos/Chocobo1/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chocobo1/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chocobo1/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chocobo1/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chocobo1/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/Chocobo1/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/Chocobo1/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/Chocobo1/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/Chocobo1/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/Chocobo1/qBittorrent/subscription","commits_url":"https://api.github.com/repos/Chocobo1/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chocobo1/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chocobo1/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chocobo1/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chocobo1/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/Chocobo1/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chocobo1/qBittorrent/merges","archive_url":"https://api.github.com/repos/Chocobo1/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chocobo1/qBittorrent/downloads","issues_url":"https://api.github.com/repos/Chocobo1/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/Chocobo1/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/Chocobo1/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/Chocobo1/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chocobo1/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/Chocobo1/qBittorrent/releases{/id}","deployments_url":"https://api.github.com/repos/Chocobo1/qBittorrent/deployments","created_at":"2015-02-07T15:14:20Z","updated_at":"2018-04-08T05:19:18Z","pushed_at":"2018-04-08T05:24:37Z","git_url":"git://github.com/Chocobo1/qBittorrent.git","ssh_url":"git@github.com:Chocobo1/qBittorrent.git","clone_url":"https://github.com/Chocobo1/qBittorrent.git","svn_url":"https://github.com/Chocobo1/qBittorrent","homepage":"http://www.qbittorrent.org","size":157166,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"qbittorrent:master","ref":"master","sha":"3301e9cb69f5d843b7de037a612a5f6e8d886031","user":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars2.githubusercontent.com/u/2131270?v=4","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":3351871,"name":"qBittorrent","full_name":"qbittorrent/qBittorrent","owner":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars2.githubusercontent.com/u/2131270?v=4","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qbittorrent/qBittorrent","description":"qBittorrent BitTorrent client","fork":false,"url":"https://api.github.com/repos/qbittorrent/qBittorrent","forks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/forks","keys_url":"https://api.github.com/repos/qbittorrent/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qbittorrent/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qbittorrent/qBittorrent/teams","hooks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/events","assignees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/qbittorrent/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/tags","blobs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/qbittorrent/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscription","commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/qbittorrent/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qbittorrent/qBittorrent/merges","archive_url":"https://api.github.com/repos/qbittorrent/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qbittorrent/qBittorrent/downloads","issues_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/qbittorrent/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/qbittorrent/qBittorrent/releases{/id}","deployments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/deployments","created_at":"2012-02-04T09:37:46Z","updated_at":"2018-04-08T06:10:30Z","pushed_at":"2018-04-08T05:24:39Z","git_url":"git://github.com/qbittorrent/qBittorrent.git","ssh_url":"git@github.com:qbittorrent/qBittorrent.git","clone_url":"https://github.com/qbittorrent/qBittorrent.git","svn_url":"https://github.com/qbittorrent/qBittorrent","homepage":"https://www.qbittorrent.org","size":161809,"stargazers_count":4120,"watchers_count":4120,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":800,"mirror_url":null,"archived":false,"open_issues_count":2982,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":800,"open_issues":2982,"watchers":4120,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/8699"},"issue":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8699"},"comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/8699/comments"},"review_comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699/comments"},"review_comment":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/8699/commits"},"statuses":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/76d55dabcf6cc60160b9e9f50dc948aa61d9dcdb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"glassez"}}