Added the setting of the senderID in the xml.
This commit is contained in:
parent
adefab34cc
commit
00f70f19fb
@ -148,4 +148,14 @@ public class Client {
|
|||||||
client.close();
|
client.close();
|
||||||
return users.getUser().get(0);
|
return users.getUser().get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the user ID.
|
||||||
|
* @return userID
|
||||||
|
* @since Envoy 0.1
|
||||||
|
*/
|
||||||
|
public long getSenderID() {
|
||||||
|
return user.getID();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -138,7 +138,7 @@ public class ChatWindow extends JFrame {
|
|||||||
|
|
||||||
// TODO: Acquire proper sender id
|
// TODO: Acquire proper sender id
|
||||||
if (!messageEnterTextfield.getText().isEmpty() && recipientID != 0) try {
|
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);
|
client.sendMessage(message);
|
||||||
appendMessageToChat(message);
|
appendMessageToChat(message);
|
||||||
messageEnterTextfield.setText("");
|
messageEnterTextfield.setText("");
|
||||||
|
Reference in New Issue
Block a user