}
// fills in data from cached view of original actor
final StreamEntityDTO originalActor = activity.getOriginalActor();
if (originalActor != null)
{
StreamDTO originalActorStreamDTO = null;
if (originalActor.getType() == EntityType.PERSON)
{
List<PersonModelView> people = getPersonModelViewsByAccountIdsMapper.execute(Collections
.singletonList(originalActor.getUniqueIdentifier()));
if (!people.isEmpty())
{
originalActorStreamDTO = people.get(0);
}
}
if (originalActor.getType() == EntityType.GROUP)
{
List<DomainGroupModelView> oagroups = groupMapper.execute(Collections.singletonList(originalActor
.getUniqueIdentifier()));
if (!oagroups.isEmpty())
{
originalActorStreamDTO = oagroups.get(0);
}
}
if (originalActorStreamDTO != null)
{
originalActor.setId(originalActorStreamDTO.getEntityId());
originalActor.setDestinationEntityId(originalActorStreamDTO.getEntityId());
originalActor.setDisplayName(originalActorStreamDTO.getDisplayName());
originalActor.setAvatarId(originalActorStreamDTO.getAvatarId());
}
else
{
// this is to prevent JSON serializer from dying on a nulled out StreamEntityDTO.
activity.setOriginalActor(null);