@Override public String getAvatarUrl(final ApplicationUser user) { if (user != null && avatarService.isUsingExternalAvatar(getLoggedInUser(), user)) { // If Gravatar is enabled we do not need to add Avatar as attachment return avatarService.getAvatarUrlNoPermCheck(user, Avatar.Size.defaultSize()).toString(); } return addAttachmentAndReturnCid(createUserAvatarAttachment(user)); }
@Override protected void defaultDoGet(HttpServletRequest request, HttpServletResponse response, String ownerId, Long avatarId, AvatarManager.ImageSize size) throws IOException, ServletException { final AvatarService avatarService = ComponentAccessor.getAvatarService(); final ApplicationUser avatarUser = getUserUtil().getUserByName(ownerId); if (avatarUser != null && avatarService.isUsingExternalAvatar(getAuthenticationContext().getUser(), avatarUser)) { redirectToExternalAvatar(response, ownerId, size); return; } super.defaultDoGet(request, response, ownerId, avatarId, size); }