Fix AccountInfo.has_avatar_info() that wrongly always returns true

AccountInfo.has_avatar_info() checks whether the AccountInfo contains
an avatar field. This is currently always true. Set this field on
server side only if an avatar provider is installed.

Change-Id: Ib73bd925d70d5049688ae9a57a058645b2cbda41
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin 2014-05-28 08:29:45 +02:00 committed by Edwin Kempin
parent fdab699958
commit 187fdbbe89

View File

@ -101,9 +101,9 @@ public class InternalAccountDirectory extends AccountDirectory {
info.username = account.getUserName();
}
if (options.contains(FillOptions.AVATARS)) {
info.avatars = Lists.newArrayListWithCapacity(1);
AvatarProvider ap = avatar.get();
if (ap != null) {
info.avatars = Lists.newArrayListWithCapacity(1);
String u = ap.getUrl(
userFactory.create(account.getId()),
AvatarInfo.DEFAULT_SIZE);