Apply suggestions from code review
Co-authored-by: CyB3RC0nN0R <kske@outlook.de>
This commit is contained in:
@ -7,9 +7,10 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import envoy.client.net.WriteProxy;
|
||||
import envoy.data.*;
|
||||
import envoy.data.Contact;
|
||||
import envoy.data.Message;
|
||||
import envoy.data.Message.MessageStatus;
|
||||
import envoy.event.IsWriting;
|
||||
import envoy.data.User;
|
||||
import envoy.event.MessageStatusChange;
|
||||
|
||||
/**
|
||||
@ -33,8 +34,7 @@ public class Chat implements Serializable {
|
||||
protected int unreadAmount;
|
||||
|
||||
/**
|
||||
* Counts the milliseconds until another {@link IsWriting} event will be sent if
|
||||
* something is typed.
|
||||
* Stores the last time an {@link envoy.event.IsWriting} event has been sent.
|
||||
*/
|
||||
protected transient long lastWritingEvent;
|
||||
|
||||
@ -145,19 +145,8 @@ public class Chat implements Serializable {
|
||||
public Contact getRecipient() { return recipient; }
|
||||
|
||||
/**
|
||||
* @return whether this {@link Chat} points at a {@link User}
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
public boolean isUserChat() { return recipient instanceof User; }
|
||||
|
||||
/**
|
||||
* @return whether this {@link Chat} points at a {@link Group}
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
public boolean isGroupChat() { return recipient instanceof Group; }
|
||||
|
||||
/**
|
||||
* @return the last known time a {@link IsWriting} event has been sent
|
||||
* @return the last known time a {@link envoy.event.IsWriting} event has been
|
||||
* sent
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public long getLastWritingEvent() { return lastWritingEvent; }
|
||||
|
@ -31,7 +31,7 @@ public class ChatControl extends HBox {
|
||||
|
||||
// Unread messages
|
||||
if (chat.getUnreadAmount() != 0) {
|
||||
final Region spacing = new Region();
|
||||
final var spacing = new Region();
|
||||
setHgrow(spacing, Priority.ALWAYS);
|
||||
getChildren().add(spacing);
|
||||
final var unreadMessagesLabel = new Label(Integer.toString(chat.getUnreadAmount()));
|
||||
|
Reference in New Issue
Block a user