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