Skip to content

Commit

Permalink
Issue ippontech#660 - make invisible delete user status shared by tim…
Browse files Browse the repository at this point in the history
…eline user.
  • Loading branch information
Jérôme Mainaud committed Nov 5, 2014
1 parent 51aaae6 commit e0753b8
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/main/java/fr/ippon/tatami/service/TimelineService.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ public Collection<StatusDTO> buildStatusList(List<String> line) {
statusDTO.setTimelineId(share.getStatusId());
statusDTO.setSharedByUsername(share.getUsername());
statusUser = userService.getUserByLogin(originalStatus.getLogin());
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
if (statusUser != null) {
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
} else {
log.debug("User of original status has been deleted");
}
} else {
log.debug("Original status has been deleted");
}
Expand All @@ -234,7 +238,11 @@ public Collection<StatusDTO> buildStatusList(List<String> line) {
statusDTO.setTimelineId(mentionShare.getStatusId());
statusDTO.setSharedByUsername(mentionShare.getUsername());
statusUser = userService.getUserByLogin(mentionShare.getLogin());
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
if (statusUser != null) {
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
} else {
log.debug("User of original status has been deleted");
}
} else {
log.debug("Mentioned status has been deleted");
}
Expand All @@ -243,19 +251,27 @@ public Collection<StatusDTO> buildStatusList(List<String> line) {
statusDTO.setTimelineId(mentionFriend.getStatusId());
statusDTO.setSharedByUsername(mentionFriend.getUsername());
statusUser = userService.getUserByLogin(mentionFriend.getFollowerLogin());
statusDTO.setFirstName(statusUser.getFirstName());
statusDTO.setLastName(statusUser.getLastName());
statusDTO.setAvatar(statusUser.getAvatar());
statusDTO.setUsername(statusUser.getUsername());
statuses.add(statusDTO);
if (statusUser != null) {
statusDTO.setFirstName(statusUser.getFirstName());
statusDTO.setLastName(statusUser.getLastName());
statusDTO.setAvatar(statusUser.getAvatar());
statusDTO.setUsername(statusUser.getUsername());
statuses.add(statusDTO);
} else {
log.debug("User of original status has been deleted");
}
} else if (abstractStatus.getType().equals(StatusType.ANNOUNCEMENT)) {
Announcement announcement = (Announcement) abstractStatus;
AbstractStatus originalStatus = statusRepository.findStatusById(announcement.getOriginalStatusId());
if (originalStatus != null) { // Find the status that was announced
statusDTO.setTimelineId(announcement.getStatusId());
statusDTO.setSharedByUsername(announcement.getUsername());
statusUser = userService.getUserByLogin(originalStatus.getLogin());
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
if (statusUser != null) {
addStatusToLine(statuses, statusDTO, originalStatus, statusUser, usergroups, favoriteLine);
} else {
log.debug("User of original status has been deleted");
}
} else {
log.debug("Announced status has been deleted");
}
Expand Down

0 comments on commit e0753b8

Please sign in to comment.