Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- #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
- Fix: MUC occupant list does not sort itself on nicknames or roles changes

### Breaking changes:

Expand Down
5 changes: 5 additions & 0 deletions src/headless/plugins/muc/occupants.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const { u } = converse.env;
class ChatRoomOccupants extends Collection {
model = ChatRoomOccupant;

initialize() {
this.on('change:nick', () => this.sort());
this.on('change:role', () => this.sort());
}

comparator (occupant1, occupant2) { // eslint-disable-line class-methods-use-this
const role1 = occupant1.get('role') || 'none';
const role2 = occupant2.get('role') || 'none';
Expand Down
Loading