I've implemented two alternatives.
[This] (https://github.com/459below/jitsi/commit/e814fafcceeb297d4256f9086064c1dc4eb20d75) one changes the TreeSet to a HashMap, which then gets sorted to determine the highest priority.
But i wasn't very happy with the result. So I resolved the issue [here](https://github.com/459below/jitsi/commit/a4892d4b07b335312fbd4461a462b0df01924823) in a different way. I haven't found a way to sort a set in a significant simpler way, than the TreeSet already used here. So instead I modified the Comparator function to make sure it will never deem two objects equal. And since there sometimes just is no way to establish a greater or less than relationship of two priorities or presences, it shouldn't matter at all in what order those same prioritized Presence objects are represented in the TreeSet.
Reply to this email directly or view it on GitHub: