mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Force messages sent through the chat to be to the chat participant.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1952 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
6a8fdecdc2
commit
e7417b27bc
1 changed files with 10 additions and 7 deletions
|
@ -177,16 +177,19 @@ public class Chat {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sends a message to the other chat participant. The thread property of
|
||||
* the message will automatically set to this chat ID in case the Message
|
||||
* was not created using the {@link #createMessage() createMessage} method.
|
||||
* Sends a message to the other chat participant. The thread ID, recipient,
|
||||
* and message type of the message will automatically set to those of this chat
|
||||
* in case the Message was not created using the {@link #createMessage() createMessage}
|
||||
* method.
|
||||
*
|
||||
* @param message
|
||||
* @throws XMPPException
|
||||
* @param message the message to send.
|
||||
* @throws XMPPException if an error occurs sending the message.
|
||||
*/
|
||||
public void sendMessage(Message message) throws XMPPException {
|
||||
// Force the chatID since the user elected to send the message
|
||||
// through this chat object.
|
||||
// Force the recipient, message type, and thread ID since the user elected
|
||||
// to send the message through this chat object.
|
||||
message.setTo(participant);
|
||||
message.setType(Message.Type.CHAT);
|
||||
message.setThread(chatID);
|
||||
connection.sendPacket(message);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue