private void addToMessagesCheckQueue(final MessageWrapper message) { if (User.get().getUserId().equals(message.getUserId())) { logger.info("Adding message to waiting queue: " + message.getText()); waitingMessages.put(Duration.currentTimeMillis(), message); fireEvent(new MessageInLimboEvent(message)); } }
public void markMessageArrived(final Message message) { if (User.get().getUserId().equals(message.getUserId())) { logger.info("Removing message from waiting queue: " + message.getText()); final Iterator<Entry<Double, Message>> it = waitingMessages.entrySet().iterator(); while (it.hasNext()) { if (message.getId().equals(it.next().getValue().getId())) { it.remove(); } } } }