mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-01 18:53:16 +00:00
Update DeleteAccountPipeline
This commit is contained in:
parent
9c83451831
commit
fae385989e
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use DB;
|
use DB;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use App\{
|
use App\{
|
||||||
AccountLog,
|
AccountLog,
|
||||||
Activity,
|
Activity,
|
||||||
|
@ -74,12 +75,16 @@ class DeleteAccountPipeline implements ShouldQueue
|
||||||
$avatar = $user->profile->avatar;
|
$avatar = $user->profile->avatar;
|
||||||
|
|
||||||
if(is_file($avatar->media_path)) {
|
if(is_file($avatar->media_path)) {
|
||||||
|
if($avatar->media_path != 'public/avatars/default.png') {
|
||||||
unlink($avatar->media_path);
|
unlink($avatar->media_path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(is_file($avatar->thumb_path)) {
|
if(is_file($avatar->thumb_path)) {
|
||||||
|
if($avatar->thumb_path != 'public/avatars/default.png') {
|
||||||
unlink($avatar->thumb_path);
|
unlink($avatar->thumb_path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$avatar->forceDelete();
|
$avatar->forceDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue