Moved client to net package, removed unnecessary recipient property

This commit is contained in:
2020-02-04 19:46:18 +01:00
parent 44541936d3
commit 8f967afa88
3 changed files with 15 additions and 36 deletions

View File

@ -10,11 +10,11 @@ import javax.swing.*;
import javax.swing.border.EmptyBorder;
import envoy.client.Chat;
import envoy.client.Client;
import envoy.client.Settings;
import envoy.client.database.LocalDb;
import envoy.client.event.MessageCreationEvent;
import envoy.client.event.ThemeChangeEvent;
import envoy.client.net.Client;
import envoy.client.ui.list.ComponentList;
import envoy.client.ui.settings.SettingsScreen;
import envoy.client.util.EnvoyLog;
@ -175,8 +175,7 @@ public class ChatWindow extends JFrame {
// Read current Chat
currentChat.read();
// Set recipient in client and chat title
client.setRecipient(user);
// Set chat title
textPane.setText(currentChat.getRecipient().getName());
// Update model and scroll down
@ -257,7 +256,7 @@ public class ChatWindow extends JFrame {
}
private void postMessage() {
if (!client.hasRecipient()) {
if (userList.isSelectionEmpty()) {
JOptionPane.showMessageDialog(this, "Please select a recipient!", "Cannot send message", JOptionPane.INFORMATION_MESSAGE);
return;
}
@ -275,7 +274,6 @@ public class ChatWindow extends JFrame {
// Add message to PersistentLocalDb and update UI
currentChat.appendMessage(message);
// messageList.setModel(currentChat.getModel());
// Clear text field
messageEnterTextArea.setText("");