X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fdeleteuser.php;h=4e6b27395389406f627cec8bed330ebfe62b274f;hb=a93d0dc16af0438af59d14f8413dabb80c13b707;hp=c4f84fad2d82d03711b703891bd1045c8862b8ff;hpb=a092aac32d061c8f6265c9975040e9f8c0b96f55;p=quix0rs-gnu-social.git diff --git a/actions/deleteuser.php b/actions/deleteuser.php index c4f84fad2d..4e6b273953 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -162,7 +162,15 @@ class DeleteuserAction extends ProfileFormAction function handlePost() { if (Event::handle('StartDeleteUser', array($this, $this->user))) { - $this->user->delete(); + // Mark the account as deleted and shove low-level deletion tasks + // to background queues. Removing a lot of posts can take a while... + if (!$this->user->hasRole(Profile_role::DELETED)) { + $this->user->grantRole(Profile_role::DELETED); + } + + $qm = QueueManager::get(); + $qm->enqueue($this->user, 'deluser'); + Event::handle('EndDeleteUser', array($this, $this->user)); } }