Currently PresenceStore keeps best presence for room for occupant based on occupant bare jid. It should keep best presence based on occupant nickname as in case when:
user t1@example.com/r1 joins as R1 online with priority 10
user t1@example.com/r2 joins as R2 away with priority 20
then best presence for occupant R1 would be returned by PresenceStore as away with priority 20 as occupant R1 and R2 will have same bare jid, which is incorrect.
This should be changed to use nickname as key for map of best presences instead of bare jid.
I've also found some methods having bare jid as only argument which references to bare jid of occupant. I think we should change to jid or nickname or remove this methods if they are not required to avoid incorrect usage and confusion.
Currently PresenceStore keeps best presence for room for occupant based on occupant bare jid. It should keep best presence based on occupant nickname as in case when:
user t1@example.com/r1 joins as R1 online with priority 10
user t1@example.com/r2 joins as R2 away with priority 20
then best presence for occupant R1 would be returned by PresenceStore as away with priority 20 as occupant R1 and R2 will have same bare jid, which is incorrect.
This should be changed to use nickname as key for map of best presences instead of bare jid.
I've also found some methods having bare jid as only argument which references to bare jid of occupant. I think we should change to jid or nickname or remove this methods if they are not required to avoid incorrect usage and confusion.