{"action":"created","comment":{"url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/comments/72889713","id":72889713,"diff_hunk":"@@ -165,22 +168,39 @@ public override void OnStart()\n                 }\r\n             }\r\n             else\r\n-            {\r\n-                if (_myHook != null)\r\n-                {\r\n-                    QBCLog.Info(\"Removing hook\");\r\n-                    TreeHooks.Instance.RemoveHook(\"Questbot_Profile\", _myHook);\r\n-                    _myHook = null;\r\n-                }\r\n-                else\r\n+\t\t\t{\r\n+\t\t\t\tif (!RemoveHook())\r\n                 {\r\n                     QBCLog.Info(\"Remove was requested, but hook was not present\");\r\n                 }\r\n             }\r\n         }\r\n \r\n+\t    private bool RemoveHook()\r\n+\t    {\r\n+\t\t    if (_myHook == null)\r\n+\t\t\t    return false;\r\n+\r\n+\t\t\tQBCLog.Info(\"Removing hook\");\r\n+\t\t\tTreeHooks.Instance.RemoveHook(\"Questbot_Profile\", _myHook);\r\n+\r\n+\t\t\tBotEvents.OnBotStopped -= BotEvents_OnBotStopped;\r\n+\t\t\tBotEvents.Profile.OnNewProfileLoaded -= Profile_OnNewProfileLoaded;\r\n+\t\t\t_myHook = null;\r\n+\t\t    return true;\r\n+\t    }\r\n+\r\n+\t\tprivate void Profile_OnNewProfileLoaded(BotEvents.Profile.NewProfileLoadedEventArgs args)\r\n+\t\t{\r\n+\t\t\tRemoveHook();\r\n+\t\t}\r\n+\r\n+\t\tprivate void BotEvents_OnBotStopped(EventArgs args)\r\n+\t\t{\r\n+\t\t\tRemoveHook();\r\n+\t\t}\r","path":"Quest Behaviors/Hooks/MountHook.cs","position":59,"original_position":59,"commit_id":"b2855c885077f18846f5158859efaf904e83ae98","original_commit_id":"b2855c885077f18846f5158859efaf904e83ae98","user":{"login":"Janiels","id":7887810,"avatar_url":"https://avatars.githubusercontent.com/u/7887810?v=3","gravatar_id":"","url":"https://api.github.com/users/Janiels","html_url":"https://github.com/Janiels","followers_url":"https://api.github.com/users/Janiels/followers","following_url":"https://api.github.com/users/Janiels/following{/other_user}","gists_url":"https://api.github.com/users/Janiels/gists{/gist_id}","starred_url":"https://api.github.com/users/Janiels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Janiels/subscriptions","organizations_url":"https://api.github.com/users/Janiels/orgs","repos_url":"https://api.github.com/users/Janiels/repos","events_url":"https://api.github.com/users/Janiels/events{/privacy}","received_events_url":"https://api.github.com/users/Janiels/received_events","type":"User","site_admin":false},"body":"A lot of this uses tabs","created_at":"2016-07-30T15:56:38Z","updated_at":"2016-07-30T15:56:38Z","html_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13#discussion_r72889713","pull_request_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/comments/72889713"},"html":{"href":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13#discussion_r72889713"},"pull_request":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13","id":79460626,"html_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13","diff_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13.diff","patch_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13.patch","issue_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/13","number":13,"state":"open","locked":false,"title":"Remove MountHook on bot stop or profile load","user":{"login":"raphudo","id":11994233,"avatar_url":"https://avatars.githubusercontent.com/u/11994233?v=3","gravatar_id":"","url":"https://api.github.com/users/raphudo","html_url":"https://github.com/raphudo","followers_url":"https://api.github.com/users/raphudo/followers","following_url":"https://api.github.com/users/raphudo/following{/other_user}","gists_url":"https://api.github.com/users/raphudo/gists{/gist_id}","starred_url":"https://api.github.com/users/raphudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphudo/subscriptions","organizations_url":"https://api.github.com/users/raphudo/orgs","repos_url":"https://api.github.com/users/raphudo/repos","events_url":"https://api.github.com/users/raphudo/events{/privacy}","received_events_url":"https://api.github.com/users/raphudo/received_events","type":"User","site_admin":false},"body":"#HB-2832 Fixed Changelog MountHook will now be removed when the bot is stopped or a new profile is loaded.","created_at":"2016-07-30T15:53:12Z","updated_at":"2016-07-30T15:56:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfd40f01800df33c91015c1a921d3285b06dad08","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13/commits","review_comments_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13/comments","review_comment_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/13/comments","statuses_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/statuses/b2855c885077f18846f5158859efaf904e83ae98","head":{"label":"raphudo:mounthook_fix","ref":"mounthook_fix","sha":"b2855c885077f18846f5158859efaf904e83ae98","user":{"login":"raphudo","id":11994233,"avatar_url":"https://avatars.githubusercontent.com/u/11994233?v=3","gravatar_id":"","url":"https://api.github.com/users/raphudo","html_url":"https://github.com/raphudo","followers_url":"https://api.github.com/users/raphudo/followers","following_url":"https://api.github.com/users/raphudo/following{/other_user}","gists_url":"https://api.github.com/users/raphudo/gists{/gist_id}","starred_url":"https://api.github.com/users/raphudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphudo/subscriptions","organizations_url":"https://api.github.com/users/raphudo/orgs","repos_url":"https://api.github.com/users/raphudo/repos","events_url":"https://api.github.com/users/raphudo/events{/privacy}","received_events_url":"https://api.github.com/users/raphudo/received_events","type":"User","site_admin":false},"repo":{"id":64543944,"name":"Honorbuddy-Quest-Behaviors","full_name":"raphudo/Honorbuddy-Quest-Behaviors","owner":{"login":"raphudo","id":11994233,"avatar_url":"https://avatars.githubusercontent.com/u/11994233?v=3","gravatar_id":"","url":"https://api.github.com/users/raphudo","html_url":"https://github.com/raphudo","followers_url":"https://api.github.com/users/raphudo/followers","following_url":"https://api.github.com/users/raphudo/following{/other_user}","gists_url":"https://api.github.com/users/raphudo/gists{/gist_id}","starred_url":"https://api.github.com/users/raphudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphudo/subscriptions","organizations_url":"https://api.github.com/users/raphudo/orgs","repos_url":"https://api.github.com/users/raphudo/repos","events_url":"https://api.github.com/users/raphudo/events{/privacy}","received_events_url":"https://api.github.com/users/raphudo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raphudo/Honorbuddy-Quest-Behaviors","description":"Quest behaviors for Honorbuddy","fork":true,"url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors","forks_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/forks","keys_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/teams","hooks_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/hooks","issue_events_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/issues/events{/number}","events_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/events","assignees_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/assignees{/user}","branches_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/branches{/branch}","tags_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/tags","blobs_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/git/refs{/sha}","trees_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/statuses/{sha}","languages_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/languages","stargazers_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/stargazers","contributors_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/contributors","subscribers_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/subscribers","subscription_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/subscription","commits_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/commits{/sha}","git_commits_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/git/commits{/sha}","comments_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/comments{/number}","issue_comment_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/issues/comments{/number}","contents_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/contents/{+path}","compare_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/merges","archive_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/downloads","issues_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/issues{/number}","pulls_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/pulls{/number}","milestones_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/milestones{/number}","notifications_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/labels{/name}","releases_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/releases{/id}","deployments_url":"https://api.github.com/repos/raphudo/Honorbuddy-Quest-Behaviors/deployments","created_at":"2016-07-30T12:52:59Z","updated_at":"2016-07-30T12:53:01Z","pushed_at":"2016-07-30T15:52:52Z","git_url":"git://github.com/raphudo/Honorbuddy-Quest-Behaviors.git","ssh_url":"git@github.com:raphudo/Honorbuddy-Quest-Behaviors.git","clone_url":"https://github.com/raphudo/Honorbuddy-Quest-Behaviors.git","svn_url":"https://github.com/raphudo/Honorbuddy-Quest-Behaviors","homepage":"http://honorbuddy.com","size":26006,"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":"BosslandGmbH:master","ref":"master","sha":"e86b9e2a990674e1fd3e6dbc60bb2bdfecc0d9a4","user":{"login":"BosslandGmbH","id":7963704,"avatar_url":"https://avatars.githubusercontent.com/u/7963704?v=3","gravatar_id":"","url":"https://api.github.com/users/BosslandGmbH","html_url":"https://github.com/BosslandGmbH","followers_url":"https://api.github.com/users/BosslandGmbH/followers","following_url":"https://api.github.com/users/BosslandGmbH/following{/other_user}","gists_url":"https://api.github.com/users/BosslandGmbH/gists{/gist_id}","starred_url":"https://api.github.com/users/BosslandGmbH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BosslandGmbH/subscriptions","organizations_url":"https://api.github.com/users/BosslandGmbH/orgs","repos_url":"https://api.github.com/users/BosslandGmbH/repos","events_url":"https://api.github.com/users/BosslandGmbH/events{/privacy}","received_events_url":"https://api.github.com/users/BosslandGmbH/received_events","type":"Organization","site_admin":false},"repo":{"id":63529386,"name":"Honorbuddy-Quest-Behaviors","full_name":"BosslandGmbH/Honorbuddy-Quest-Behaviors","owner":{"login":"BosslandGmbH","id":7963704,"avatar_url":"https://avatars.githubusercontent.com/u/7963704?v=3","gravatar_id":"","url":"https://api.github.com/users/BosslandGmbH","html_url":"https://github.com/BosslandGmbH","followers_url":"https://api.github.com/users/BosslandGmbH/followers","following_url":"https://api.github.com/users/BosslandGmbH/following{/other_user}","gists_url":"https://api.github.com/users/BosslandGmbH/gists{/gist_id}","starred_url":"https://api.github.com/users/BosslandGmbH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BosslandGmbH/subscriptions","organizations_url":"https://api.github.com/users/BosslandGmbH/orgs","repos_url":"https://api.github.com/users/BosslandGmbH/repos","events_url":"https://api.github.com/users/BosslandGmbH/events{/privacy}","received_events_url":"https://api.github.com/users/BosslandGmbH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors","description":"Quest behaviors for Honorbuddy","fork":false,"url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors","forks_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/forks","keys_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/teams","hooks_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/hooks","issue_events_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/events{/number}","events_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/events","assignees_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/assignees{/user}","branches_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/branches{/branch}","tags_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/tags","blobs_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/git/refs{/sha}","trees_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/statuses/{sha}","languages_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/languages","stargazers_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/stargazers","contributors_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/contributors","subscribers_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/subscribers","subscription_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/subscription","commits_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/commits{/sha}","git_commits_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/git/commits{/sha}","comments_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/comments{/number}","issue_comment_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/comments{/number}","contents_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/contents/{+path}","compare_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/merges","archive_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/downloads","issues_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues{/number}","pulls_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls{/number}","milestones_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/milestones{/number}","notifications_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/labels{/name}","releases_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/releases{/id}","deployments_url":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/deployments","created_at":"2016-07-17T11:50:42Z","updated_at":"2016-07-26T12:03:12Z","pushed_at":"2016-07-30T15:53:12Z","git_url":"git://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors.git","ssh_url":"git@github.com:BosslandGmbH/Honorbuddy-Quest-Behaviors.git","clone_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors.git","svn_url":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors","homepage":"http://honorbuddy.com","size":26381,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13"},"html":{"href":"https://github.com/BosslandGmbH/Honorbuddy-Quest-Behaviors/pull/13"},"issue":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/13"},"comments":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/BosslandGmbH/Honorbuddy-Quest-Behaviors/statuses/b2855c885077f18846f5158859efaf904e83ae98"}}}}
{"actor":{"display_login":"Janiels"}}