Fix double status increment on cached message relay

This commit is contained in:
Kai S. K. Engelbart 2020-06-26 09:28:48 +02:00
parent 295e2a8596
commit dad05449cf
3 changed files with 6 additions and 5 deletions

View File

@ -10,8 +10,8 @@ import java.util.logging.Logger;
import envoy.util.EnvoyLog;
/**
* Stores elements in a queue to process them later.<br>
* <br>
* Stores elements in a queue to process them later.
* <p>
* Project: <strong>envoy-client</strong><br>
* File: <strong>Cache.java</strong><br>
* Created: <strong>6 Feb 2020</strong><br>
@ -40,6 +40,9 @@ public class Cache<T> implements Consumer<T>, Serializable {
elements.offer(element);
}
@Override
public String toString() { return String.format("Cache[elements=" + elements + "]"); }
/**
* Sets the processor to which cached elements are relayed.
*

View File

@ -47,9 +47,6 @@ public class WriteProxy {
try {
logger.log(Level.FINER, "Sending cached " + msg);
client.sendMessage(msg);
// Update message state to SENT in localDB
localDB.getMessage(msg.getID()).ifPresent(Message::nextStatus);
} catch (final IOException e) {
logger.log(Level.SEVERE, "Could not send cached message: ", e);
}

View File

@ -164,6 +164,7 @@ public final class ChatScene {
private void userListClicked() {
final Contact user = userList.getSelectionModel().getSelectedItem();
if (user != null && (currentChat == null || !user.equals(currentChat.getRecipient()))) {
logger.log(Level.FINEST, "Loading chat with " + user);
contactLabel.setText(user.getName());
// LEON: JFC <===> JAVA FRIED CHICKEN <=/=> Java Foundation Classes