Added the setting of the senderID in the xml.

This commit is contained in:
Maxi 2019-10-12 17:35:58 +02:00
parent d5dd076ce2
commit b9157ca992
2 changed files with 11 additions and 1 deletions

View File

@ -148,4 +148,14 @@ public class Client {
client.close();
return users.getUser().get(0);
}
/**
* Returns the user ID.
* @return userID
* @since Envoy 0.1
*/
public long getSenderID() {
return user.getID();
}
}

View File

@ -138,7 +138,7 @@ public class ChatWindow extends JFrame {
// TODO: Acquire proper sender id
if (!messageEnterTextfield.getText().isEmpty() && recipientID != 0) try {
final Message message = client.createMessage(1, recipientID, messageEnterTextfield.getText());
final Message message = client.createMessage(client.getSenderID(), recipientID, messageEnterTextfield.getText());
client.sendMessage(message);
appendMessageToChat(message);
messageEnterTextfield.setText("");