From f31411c99753036c9761305754f4772a8e140e07 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Tue, 5 Dec 2006 07:46:29 +0000 Subject: [PATCH] A FROM value was not always present in messages sent as part of the chat. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6308 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/ChatManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/org/jivesoftware/smack/ChatManager.java b/source/org/jivesoftware/smack/ChatManager.java index 23c31571c..20f9969b7 100644 --- a/source/org/jivesoftware/smack/ChatManager.java +++ b/source/org/jivesoftware/smack/ChatManager.java @@ -20,11 +20,14 @@ package org.jivesoftware.smack; -import org.jivesoftware.smack.util.StringUtils; -import org.jivesoftware.smack.util.collections.ReferenceMap; +import org.jivesoftware.smack.filter.AndFilter; +import org.jivesoftware.smack.filter.FromContainsFilter; +import org.jivesoftware.smack.filter.PacketFilter; +import org.jivesoftware.smack.filter.ThreadFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Packet; -import org.jivesoftware.smack.filter.*; +import org.jivesoftware.smack.util.StringUtils; +import org.jivesoftware.smack.util.collections.ReferenceMap; import java.util.*; import java.util.concurrent.CopyOnWriteArraySet; @@ -215,6 +218,10 @@ public class ChatManager { interceptor.getKey().interceptPacket(message); } } + // Ensure that messages being sent have a proper FROM value + if (message.getFrom() == null) { + message.setFrom(connection.getUser()); + } connection.sendPacket(message); }