1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +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 * Sends a message to the other chat participant. The thread ID, recipient,
* the message will automatically set to this chat ID in case the Message * and message type of the message will automatically set to those of this chat
* was not created using the {@link #createMessage() createMessage} method. * in case the Message was not created using the {@link #createMessage() createMessage}
* method.
* *
* @param message * @param message the message to send.
* @throws XMPPException * @throws XMPPException if an error occurs sending the message.
*/ */
public void sendMessage(Message message) throws XMPPException { public void sendMessage(Message message) throws XMPPException {
// Force the chatID since the user elected to send the message // Force the recipient, message type, and thread ID since the user elected
// through this chat object. // to send the message through this chat object.
message.setTo(participant);
message.setType(Message.Type.CHAT);
message.setThread(chatID); message.setThread(chatID);
connection.sendPacket(message); connection.sendPacket(message);
} }