Exemple #1
0
 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;
 }
Exemple #2
0
 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;
 }