- $results[]=array('nickname' => $user->nickname, 'fullname'=> $user->profile->fullname, 'type'=>'user');
+ $profile = $user->getProfile();
+ $avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
+ // sigh.... encapsulate this upstream!
+ if ($avatar) {
+ $avatar = $avatar->displayUrl();
+ } else {
+ $avatar = Avatar::defaultImage(AVATAR_MINI_SIZE);
+ }
+ $results[] = array(
+ 'nickname' => $user->nickname,
+ 'fullname'=> $profile->fullname,
+ 'avatar' => $avatar,
+ 'type' => 'user'
+ );