Originnaly using asmack I got this issue.
I’m using ChatListener to be fired on incoming private chats from MUC like email@example.com/someuser. This way ChatListener fired at first private chat then maps all incoming private chats to that*, first thread*.
Alternatively this can be solved by using packet listener on connection and filtering by message.getFrom(). But I supose there will be a direct solution.
Original github issue.