res.setTotalItemsNum(items);
for(FriendsInvitation invitation: containerInvitations){
ContentRecord record = res.newItem();
record.addItemKeyField(invitation.getInvitationId());
record.addItemField(ProfileFields.PROFILE_INVITED_BY.getParamName(), invitation.getInvitedBy());
UserProfile profile = UserProfilesUtils.getProfileById(invitation.getInvitedBy());
if(profile!=null && !profile.isPrivate()){
record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(), profile.getNickName());
if( profile.getPhotoUrl()!=null && profile.getPhotoUrl().length()>0)
record.addItemField(ProfileFields.PROFILE_THUMBNAILURL.getParamName(), profile.getPhotoUrl());
}
else
record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(),ProfPrivacyStatus.PRIVATE.getPrivacyStatus());
record.setContentName("myPendingInvitatos");
record.setGadgetPermissions(false, false, false);
}
for(FriendsInvitation invitation: platformInvitations){
ContentRecord record = res.newItem();
record.addItemKeyField(invitation.getInvitationId());
record.addItemField(ProfileFields.PROFILE_INVITED_BY.getParamName(), invitation.getInvitedBy());
UserProfile profile = UserProfilesUtils.getProfileById(invitation.getInvitedBy());
if(profile!=null && !profile.isPrivate()){
record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(), profile.getNickName());
if( profile.getPhotoUrl()!=null && profile.getPhotoUrl().length()>0)
record.addItemField(ProfileFields.PROFILE_THUMBNAILURL.getParamName(), profile.getPhotoUrl());
}
else
record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(),ProfPrivacyStatus.PRIVATE.getPrivacyStatus());
record.setContentName("myPendingInvitatos");
record.setGadgetPermissions(false, false, false);
}
}
}