diff options
author | Brion Vibber <brion@status.net> | 2010-11-19 12:44:43 -0800 |
---|---|---|
committer | Brion Vibber <brion@status.net> | 2010-11-19 12:44:43 -0800 |
commit | 407663fb402f0384cced2b63a2f901d19ab71d19 (patch) | |
tree | 29ac17770a24c6a9f07afcfc5ff3071f2849722e /classes/Profile.php | |
parent | ed2bc323a18e714c9658c6ff1d86add236c26635 (diff) | |
parent | 4b01dd8b2ec18c28a49fd8963dd7e31e73b4670b (diff) |
Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 3ea95ab01..8dbdcbd97 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -125,6 +125,14 @@ class Profile extends Memcached_DataObject return $avatar; } + /** + * Delete attached avatars for this user from the database and filesystem. + * This should be used instead of a batch delete() to ensure that files + * get removed correctly. + * + * @param boolean $original true to delete only the original-size file + * @return <type> + */ function delete_avatars($original=true) { $avatar = new Avatar(); @@ -664,9 +672,11 @@ class Profile extends Memcached_DataObject $this->_deleteMessages(); $this->_deleteTags(); $this->_deleteBlocks(); + $this->delete_avatars(); - $related = array('Avatar', - 'Reply', + // Warning: delete() will run on the batch objects, + // not on individual objects. + $related = array('Reply', 'Group_member', ); Event::handle('ProfileDeleteRelated', array($this, &$related)); |