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:
parent
873067d2a2
commit
ee9c5f523c
@ -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)"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user