diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-03-13 14:16:43 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-04-24 16:27:17 +0200 |
commit | d74e9045ac5856c728e7b325ca0cfc22c92674bd (patch) | |
tree | afa5415fad3195c9e969636b9531b0854c9fec61 /lib/private/User | |
parent | 84a35361599640d838815a4127eab58e49f052fc (diff) | |
download | nextcloud-server-d74e9045ac5856c728e7b325ca0cfc22c92674bd.tar.gz nextcloud-server-d74e9045ac5856c728e7b325ca0cfc22c92674bd.zip |
Delete avatar if a user is deleted
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/User.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index dd451c8eb3f..ccf5936c659 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -36,6 +36,7 @@ namespace OC\User; use OC\Accounts\AccountManager; +use OC\Avatar\AvatarManager; use OC\Files\Cache\Storage; use OC\Hooks\Emitter; use OC_Helper; @@ -238,6 +239,10 @@ class User implements IUser { \OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid); \OC::$server->getCommentsManager()->deleteReadMarksFromUser($this); + /** @var IAvatarManager $avatarManager */ + $avatarManager = \OC::$server->query(AvatarManager::class); + $avatarManager->deleteUserAvatar($this->uid); + $notification = \OC::$server->getNotificationManager()->createNotification(); $notification->setUser($this->uid); \OC::$server->getNotificationManager()->markProcessed($notification); |