return $avatar;
}
+ /**
+ * Check if an avatar exists for the user
+ *
+ * @return bool
+ */
+ public function exists() {
+ return $this->view->file_exists('avatar.jpg') || $this->view->file_exists('avatar.png');
+ }
+
/**
* sets the users avatar
* @param \OC_Image|resource|string $data OC_Image, imagedata or path to set a new avatar
**/
public static function userAvatarSet($user) {
$avatar = new \OC_Avatar($user);
- $image = $avatar->get(1);
- if ($image instanceof \OC_Image) {
- return true;
- } else {
- return false;
- }
+ return $avatar->exists();
}
/**
*/
function get($size = 64);
+ /**
+ * Check if an avatar exists for the user
+ *
+ * @return bool
+ */
+ public function exists();
+
/**
* sets the users avatar
* @param Image $data mixed imagedata or path to set a new avatar