From e7417b27bcba7e61c7174b7c2cabef596ded4071 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Tue, 27 May 2003 15:20:00 +0000 Subject: [PATCH] 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 --- source/org/jivesoftware/smack/Chat.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/org/jivesoftware/smack/Chat.java b/source/org/jivesoftware/smack/Chat.java index bc07c686e..9c91b7da4 100644 --- a/source/org/jivesoftware/smack/Chat.java +++ b/source/org/jivesoftware/smack/Chat.java @@ -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); }