Receive messages without opening a chat

Hello together,

i have a MultiUserChat with the chance to open a private chat. If i open a private chat to a occupant of the conference, the chat get a threadId. The target chat user doesnt know this threadId. So how can i receive this message without opening a chat.

Currently i have following code:

connection.addPacketListener(this, new PacketTypeFilter(Packet.class));
...
@Override
    public void processPacket(Packet packet) {
        System.out.println("ENTER processPacket");
        if (packet instanceof Message) {
            Message msg = (Message) packet;
            textarea.append(getNickname(msg.getFrom()) + ": " + msg.getBody() + "\n");
            System.out.println("Message: " + msg.getFrom() + " " + msg.getBody());
        }
    }

With the smack debugger, i reveive the sent message, but with this packet listener not. So how can I receive a message, to create a chat with the right threadId.

thank you for your help

I solved the problem by adding this:

ChatManager chatManager = connection.getChatManager();
chatManager.addChatListener(this); ...
@Override
    public void chatCreated(Chat chat, boolean createdLocally) {
        System.out.println("Chat created: " + chat.getThreadID() + ", " + createdLocally);
    }

Now, i have the right ThreadID and can receive all messages…

But why does it not work with the XMPPConnection addPacketListener? This listener should be fired every time i receive a message, or not??