In smack 3.0.4 & 3.1.0, Roster.getPresence() ignores the presence type when selecting the presence with the highest priority.
If more than one presence entries for the same user, same priority and different resources are stored in the roster, the current implementation will choose the presence with the highest availability. While searching for the highest availability it does not consider the presence type. Thus when there are 2 entries with same priority, null mode and Type.available & Type.unavailable types respectively, the roster returns one of them randomly depending on which one comes first in the java map.
The problem manifests when a user logs in and out 3-4 times with different resources. Other users correctly see the new available presence in the PresenceListener but often get an unavaillable presence in Roster.getPresence().
Is this a bug or we shoud use presence priorities or fixed resources when connecting?