Browse Source

Fix: MUC occupant list does not sort itself on nicknames or roles changes

John Livingston 1 year ago
parent
commit
58bcbc5db2
2 changed files with 7 additions and 1 deletions
  1. 2 1
      CHANGES.md
  2. 5 0
      src/headless/plugins/muc/occupants.js

+ 2 - 1
CHANGES.md

@@ -4,8 +4,9 @@
 
 - #2716: Fix issue with chat display when opening via URL
 - #3033: Add the `muc_grouped_by_domain` option to display MUCs on the same domain in collapsible groups
-- Add an occupants filter to the MUC sidebar
 - #3307: Fix inconsistency between browsers on textarea outlines
+- Add an occupants filter to the MUC sidebar
+- Fix: MUC occupant list does not sort itself on nicknames or roles changes
 
 ### Breaking changes:
 

+ 5 - 0
src/headless/plugins/muc/occupants.js

@@ -34,6 +34,11 @@ class ChatRoomOccupants extends Collection {
         return ChatRoomOccupant;
     }
 
+    initialize() {
+        this.on('change:nick', () => this.sort());
+        this.on('change:role', () => this.sort());
+    }
+
     create (attrs, options) {
         if (attrs.id || attrs instanceof Model) {
             return super.create(attrs, options);