From 6bb444fdafc4d603e6d5a45ce693ecccd0c11a82 Mon Sep 17 00:00:00 2001 From: Alex Wenckus Date: Fri, 9 Mar 2007 17:27:20 +0000 Subject: [PATCH] NULL thread IDs no longer an issue. SMACK-203 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7424 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/ChatManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/org/jivesoftware/smack/ChatManager.java b/source/org/jivesoftware/smack/ChatManager.java index ddcbd0b56..ce9a21940 100644 --- a/source/org/jivesoftware/smack/ChatManager.java +++ b/source/org/jivesoftware/smack/ChatManager.java @@ -145,6 +145,9 @@ public class ChatManager { * @return the created chat. */ public Chat createChat(String userJID, String thread, MessageListener listener) { + if(thread == null) { + thread = nextID(); + } Chat chat = threadChats.get(thread); if(chat != null) { throw new IllegalArgumentException("ThreadID is already used"); @@ -168,6 +171,9 @@ public class ChatManager { private Chat createChat(Message message) { String threadID = message.getThread(); + if(threadID == null) { + threadID = nextID(); + } String userJID = message.getFrom(); return createChat(userJID, threadID, false);