{"action":"created","comment":{"url":"https://api.github.com/repos/linagora/james-project/pulls/comments/203020748","pull_request_review_id":137827093,"id":203020748,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzAyMDc0OA==","diff_hunk":"@@ -526,22 +529,26 @@ private boolean userHasLookupRightsOn(Mailbox mailbox, MailboxSession session) t\n     public void deleteMailbox(final MailboxPath mailboxPath, final MailboxSession session) throws MailboxException {\n         LOGGER.info(\"deleteMailbox {}\", mailboxPath);\n         assertIsOwner(session, mailboxPath);\n-        final MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);\n+        MailboxMapper mapper = mailboxSessionMapperFactory.getMailboxMapper(session);\n \n-        Mailbox mailbox = mapper.execute((Mapper.Transaction<Mailbox>) () -> {\n-            final Mailbox mailbox1 = mapper.findMailboxByPath(mailboxPath);\n+        mapper.execute((Mapper.Transaction<Mailbox>) () -> {\n+            Mailbox mailbox1 = mapper.findMailboxByPath(mailboxPath);\n             if (mailbox1 == null) {\n                 throw new MailboxNotFoundException(mailboxPath);\n             }\n \n+            QuotaRoot quotaRoot = quotaRootResolver.getQuotaRoot(mailboxPath);\n+            QuotaCount quotaCount = quotaManager.getMessageQuota(quotaRoot).getUsed();\n+            QuotaSize quotaSize = quotaManager.getStorageQuota(quotaRoot).getUsed();\n+\n             // We need to create a copy of the mailbox as maybe we can not refer to the real\n             // mailbox once we remove it\n             SimpleMailbox m = new SimpleMailbox(mailbox1);\n             mapper.delete(mailbox1);\n+            dispatcher.mailboxDeleted(session, mailbox1, quotaRoot, quotaCount, quotaSize);","path":"mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java","position":40,"original_position":40,"commit_id":"9800053aa6d7f54117b61968c5a1d25acb1e637d","original_commit_id":"9800053aa6d7f54117b61968c5a1d25acb1e637d","user":{"login":"rouazana","id":1398581,"node_id":"MDQ6VXNlcjEzOTg1ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/1398581?v=4","gravatar_id":"","url":"https://api.github.com/users/rouazana","html_url":"https://github.com/rouazana","followers_url":"https://api.github.com/users/rouazana/followers","following_url":"https://api.github.com/users/rouazana/following{/other_user}","gists_url":"https://api.github.com/users/rouazana/gists{/gist_id}","starred_url":"https://api.github.com/users/rouazana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rouazana/subscriptions","organizations_url":"https://api.github.com/users/rouazana/orgs","repos_url":"https://api.github.com/users/rouazana/repos","events_url":"https://api.github.com/users/rouazana/events{/privacy}","received_events_url":"https://api.github.com/users/rouazana/received_events","type":"User","site_admin":false},"body":"why the event get the current quota? If the event is treated later that data won't be very accurate.","created_at":"2018-07-17T13:29:21Z","updated_at":"2018-07-17T13:32:54Z","html_url":"https://github.com/linagora/james-project/pull/1551#discussion_r203020748","pull_request_url":"https://api.github.com/repos/linagora/james-project/pulls/1551","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments/203020748"},"html":{"href":"https://github.com/linagora/james-project/pull/1551#discussion_r203020748"},"pull_request":{"href":"https://api.github.com/repos/linagora/james-project/pulls/1551"}}},"pull_request":{"url":"https://api.github.com/repos/linagora/james-project/pulls/1551","id":201627586,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNjI3NTg2","html_url":"https://github.com/linagora/james-project/pull/1551","diff_url":"https://github.com/linagora/james-project/pull/1551.diff","patch_url":"https://github.com/linagora/james-project/pull/1551.patch","issue_url":"https://api.github.com/repos/linagora/james-project/issues/1551","number":1551,"state":"open","locked":false,"title":" JAMES-2468 Handle quota update on mailbox deletion ","user":{"login":"aduprat","id":2900528,"node_id":"MDQ6VXNlcjI5MDA1Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2900528?v=4","gravatar_id":"","url":"https://api.github.com/users/aduprat","html_url":"https://github.com/aduprat","followers_url":"https://api.github.com/users/aduprat/followers","following_url":"https://api.github.com/users/aduprat/following{/other_user}","gists_url":"https://api.github.com/users/aduprat/gists{/gist_id}","starred_url":"https://api.github.com/users/aduprat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduprat/subscriptions","organizations_url":"https://api.github.com/users/aduprat/orgs","repos_url":"https://api.github.com/users/aduprat/repos","events_url":"https://api.github.com/users/aduprat/events{/privacy}","received_events_url":"https://api.github.com/users/aduprat/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-16T12:52:03Z","updated_at":"2018-07-17T13:32:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"186159aae93572b30993651fe1ff7421ba2a277d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/linagora/james-project/milestones/5","html_url":"https://github.com/linagora/james-project/milestone/5","labels_url":"https://api.github.com/repos/linagora/james-project/milestones/5/labels","id":3454581,"node_id":"MDk6TWlsZXN0b25lMzQ1NDU4MQ==","number":5,"title":"polish201806","description":null,"creator":{"login":"chibenwa","id":6928740,"node_id":"MDQ6VXNlcjY5Mjg3NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":40,"state":"open","created_at":"2018-06-27T00:51:14Z","updated_at":"2018-07-17T10:26:33Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/linagora/james-project/pulls/1551/commits","review_comments_url":"https://api.github.com/repos/linagora/james-project/pulls/1551/comments","review_comment_url":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linagora/james-project/issues/1551/comments","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/9800053aa6d7f54117b61968c5a1d25acb1e637d","head":{"label":"aduprat:JAMES-2468","ref":"JAMES-2468","sha":"9800053aa6d7f54117b61968c5a1d25acb1e637d","user":{"login":"aduprat","id":2900528,"node_id":"MDQ6VXNlcjI5MDA1Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2900528?v=4","gravatar_id":"","url":"https://api.github.com/users/aduprat","html_url":"https://github.com/aduprat","followers_url":"https://api.github.com/users/aduprat/followers","following_url":"https://api.github.com/users/aduprat/following{/other_user}","gists_url":"https://api.github.com/users/aduprat/gists{/gist_id}","starred_url":"https://api.github.com/users/aduprat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduprat/subscriptions","organizations_url":"https://api.github.com/users/aduprat/orgs","repos_url":"https://api.github.com/users/aduprat/repos","events_url":"https://api.github.com/users/aduprat/events{/privacy}","received_events_url":"https://api.github.com/users/aduprat/received_events","type":"User","site_admin":false},"repo":{"id":39448317,"node_id":"MDEwOlJlcG9zaXRvcnkzOTQ0ODMxNw==","name":"james-project","full_name":"aduprat/james-project","owner":{"login":"aduprat","id":2900528,"node_id":"MDQ6VXNlcjI5MDA1Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2900528?v=4","gravatar_id":"","url":"https://api.github.com/users/aduprat","html_url":"https://github.com/aduprat","followers_url":"https://api.github.com/users/aduprat/followers","following_url":"https://api.github.com/users/aduprat/following{/other_user}","gists_url":"https://api.github.com/users/aduprat/gists{/gist_id}","starred_url":"https://api.github.com/users/aduprat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduprat/subscriptions","organizations_url":"https://api.github.com/users/aduprat/orgs","repos_url":"https://api.github.com/users/aduprat/repos","events_url":"https://api.github.com/users/aduprat/events{/privacy}","received_events_url":"https://api.github.com/users/aduprat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aduprat/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/aduprat/james-project","forks_url":"https://api.github.com/repos/aduprat/james-project/forks","keys_url":"https://api.github.com/repos/aduprat/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aduprat/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aduprat/james-project/teams","hooks_url":"https://api.github.com/repos/aduprat/james-project/hooks","issue_events_url":"https://api.github.com/repos/aduprat/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/aduprat/james-project/events","assignees_url":"https://api.github.com/repos/aduprat/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/aduprat/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/aduprat/james-project/tags","blobs_url":"https://api.github.com/repos/aduprat/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aduprat/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aduprat/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/aduprat/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aduprat/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/aduprat/james-project/languages","stargazers_url":"https://api.github.com/repos/aduprat/james-project/stargazers","contributors_url":"https://api.github.com/repos/aduprat/james-project/contributors","subscribers_url":"https://api.github.com/repos/aduprat/james-project/subscribers","subscription_url":"https://api.github.com/repos/aduprat/james-project/subscription","commits_url":"https://api.github.com/repos/aduprat/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/aduprat/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/aduprat/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/aduprat/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/aduprat/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/aduprat/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aduprat/james-project/merges","archive_url":"https://api.github.com/repos/aduprat/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aduprat/james-project/downloads","issues_url":"https://api.github.com/repos/aduprat/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/aduprat/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/aduprat/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/aduprat/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aduprat/james-project/labels{/name}","releases_url":"https://api.github.com/repos/aduprat/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/aduprat/james-project/deployments","created_at":"2015-07-21T13:55:14Z","updated_at":"2018-04-23T10:05:09Z","pushed_at":"2018-07-17T10:06:40Z","git_url":"git://github.com/aduprat/james-project.git","ssh_url":"git@github.com:aduprat/james-project.git","clone_url":"https://github.com/aduprat/james-project.git","svn_url":"https://github.com/aduprat/james-project","homepage":null,"size":38035,"stargazers_count":0,"watchers_count":0,"language":"Java","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linagora:master","ref":"master","sha":"0855a757f026ab4e8d734b6d5790ab0e380bc8f5","user":{"login":"linagora","id":1230365,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAzNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"repo":{"id":39182136,"node_id":"MDEwOlJlcG9zaXRvcnkzOTE4MjEzNg==","name":"james-project","full_name":"linagora/james-project","owner":{"login":"linagora","id":1230365,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzAzNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linagora/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/linagora/james-project","forks_url":"https://api.github.com/repos/linagora/james-project/forks","keys_url":"https://api.github.com/repos/linagora/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linagora/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linagora/james-project/teams","hooks_url":"https://api.github.com/repos/linagora/james-project/hooks","issue_events_url":"https://api.github.com/repos/linagora/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/linagora/james-project/events","assignees_url":"https://api.github.com/repos/linagora/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/linagora/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/linagora/james-project/tags","blobs_url":"https://api.github.com/repos/linagora/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linagora/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linagora/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/linagora/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/linagora/james-project/languages","stargazers_url":"https://api.github.com/repos/linagora/james-project/stargazers","contributors_url":"https://api.github.com/repos/linagora/james-project/contributors","subscribers_url":"https://api.github.com/repos/linagora/james-project/subscribers","subscription_url":"https://api.github.com/repos/linagora/james-project/subscription","commits_url":"https://api.github.com/repos/linagora/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/linagora/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/linagora/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/linagora/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/linagora/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/linagora/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linagora/james-project/merges","archive_url":"https://api.github.com/repos/linagora/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linagora/james-project/downloads","issues_url":"https://api.github.com/repos/linagora/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/linagora/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/linagora/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/linagora/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linagora/james-project/labels{/name}","releases_url":"https://api.github.com/repos/linagora/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/linagora/james-project/deployments","created_at":"2015-07-16T07:04:59Z","updated_at":"2018-07-17T10:25:19Z","pushed_at":"2018-07-17T11:45:44Z","git_url":"git://github.com/linagora/james-project.git","ssh_url":"git@github.com:linagora/james-project.git","clone_url":"https://github.com/linagora/james-project.git","svn_url":"https://github.com/linagora/james-project","homepage":null,"size":34509,"stargazers_count":21,"watchers_count":21,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":66,"license":null,"forks":25,"open_issues":66,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/1551"},"html":{"href":"https://github.com/linagora/james-project/pull/1551"},"issue":{"href":"https://api.github.com/repos/linagora/james-project/issues/1551"},"comments":{"href":"https://api.github.com/repos/linagora/james-project/issues/1551/comments"},"review_comments":{"href":"https://api.github.com/repos/linagora/james-project/pulls/1551/comments"},"review_comment":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linagora/james-project/pulls/1551/commits"},"statuses":{"href":"https://api.github.com/repos/linagora/james-project/statuses/9800053aa6d7f54117b61968c5a1d25acb1e637d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rouazana"}}