X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fdeleteuser.php;h=4e6b27395389406f627cec8bed330ebfe62b274f;hb=869a6be0f5779aff69018d02f9ac0273946040d9;hp=c4f84fad2d82d03711b703891bd1045c8862b8ff;hpb=b8001ea1079c4c8895fd2323e1e4a47c0d71fde3;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)); } }