fixed typo
This commit is contained in:
parent
bd1563b439
commit
1fef10769f
@ -46,7 +46,7 @@ public class ChatWindow extends JFrame {
|
||||
*
|
||||
* @since Envoy 0.1-beta
|
||||
*/
|
||||
public static final int MAX_MESSEAGE_LENGTH = 200;
|
||||
public static final int MAX_MESSAGE_LENGTH = 200;
|
||||
|
||||
// User specific objects
|
||||
private Client client;
|
||||
@ -575,8 +575,7 @@ public class ChatWindow extends JFrame {
|
||||
userListModel.addElement(user);
|
||||
|
||||
// Check if user exists in local DB
|
||||
if (localDb.getChats().stream().noneMatch(c -> c.getRecipient().getId() == user.getId()))
|
||||
localDb.getChats().add(new Chat(user));
|
||||
if (localDb.getChats().stream().noneMatch(c -> c.getRecipient().getId() == user.getId())) localDb.getChats().add(new Chat(user));
|
||||
});
|
||||
SwingUtilities.invokeLater(() -> userList.setModel(userListModel));
|
||||
|
||||
@ -587,15 +586,15 @@ public class ChatWindow extends JFrame {
|
||||
|
||||
/**
|
||||
* Checks whether the length of the text inside messageEnterTextArea >=
|
||||
* {@link ChatWindow#MAX_MESSEAGE_LENGTH}
|
||||
* {@link ChatWindow#MAX_MESSAGE_LENGTH}
|
||||
* and splits the text into the allowed part, if that is the case.
|
||||
*
|
||||
* @since Envoy v0.1-beta
|
||||
*/
|
||||
private void checkMessageTextLength() {
|
||||
String input = messageEnterTextArea.getText();
|
||||
if (input.length() >= MAX_MESSEAGE_LENGTH) {
|
||||
messageEnterTextArea.setText(input.substring(0, MAX_MESSEAGE_LENGTH - 1));
|
||||
if (input.length() >= MAX_MESSAGE_LENGTH) {
|
||||
messageEnterTextArea.setText(input.substring(0, MAX_MESSAGE_LENGTH - 1));
|
||||
// TODO: current notification is like being hit with a hammer, maybe it should
|
||||
// be replaced with a more subtle notification
|
||||
JOptionPane.showMessageDialog(messageEnterTextArea,
|
||||
|
Reference in New Issue
Block a user