1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +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:
Matt Tucker 2003-05-27 15:20:00 +00:00 committed by mtucker
parent 6a8fdecdc2
commit e7417b27bc

View file

@ -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);
}