public static MessageDTO privateMessage( Long toSteamId, MessageType type, String content, Long gatherId) { MessageDTO result = new MessageDTO(type, content, gatherId); result.visibility = MessageVisibility.PERSONAL; result.toSteamId = toSteamId; return result; }
public List<MessageDTO> getNewMessages(Long gatherId, Long steamId, Long since) { List<MessageDTO> result = new LinkedList<>(); for (MessageDTO messageDTO : messages) { if (messageDTO.getTimestamp() > since) { if (messageDTO.getVisibility() == MessageVisibility.BROADCAST && (messageDTO.getGatherId() == gatherId || messageDTO.getGatherId() == null) || messageDTO.getVisibility() == MessageVisibility.PERSONAL && messageDTO.getToSteamId().equals(steamId)) { result.add(messageDTO); } } } return result; }