Occupant sorting is now done by ConverseJS:

It was a bug, i made a PR on ConverseJS to fix it.
This commit is contained in:
John Livingston 2024-01-17 11:18:07 +01:00
parent 873067d2a2
commit ee9c5f523c
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 2 additions and 15 deletions

View File

@ -15,7 +15,8 @@ CONVERSE_COMMIT=""
# - #converse.js/3300: Adding the maxWait option for `debouncedPruneHistory`
# - #converse.js/3302: debounce MUC sidebar rendering
# - Fix: refresh the MUC sidebar when participants collection is sorted
CONVERSE_COMMIT="4861395f047e4abee2b30271c80d29a86baf7828"
# - Fix: MUC occupant list does not sort itself on nicknames or roles changes
CONVERSE_COMMIT="64d23bd160a9531c45604b1d7e86b4c759a1e883"
CONVERSE_REPO="https://github.com/JohnXLivingston/converse.js"
rootdir="$(pwd)"

View File

@ -121,20 +121,6 @@ window.initConverse = async function initConverse (initConverseParams: InitConve
// To mitigate this, will don't display nickname changes if the previous nick is something like
// 'Anonymous 12345'.
if (/^Anonymous \d+$/.test(nick)) {
// We are sorting anonymous users at the end, by overriding ChatRoomOccupants.comparator.
// But this has a caveat: occupants are not sorted again when nicknames changes...
// As a workaround, we re-sort the occupant list here, when we intercept a action info message
// from an anonymous user that has changed his nickname.
// FIXME: This is not very clean... but will do the work.
try {
// Moreover, we can't sort now, as the new nickname is not saved in the Collection...
// So using a setTimout
// FIXME: find a better way
setTimeout(() => this.occupants.sort(), 100)
} catch (err) {
console.error(err)
}
// To avoid displaying the message, we just have to return an empty one
// (createInfoMessage will ignore if !data.message).
return null