mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 18:25:49 +03:00
Don't group blank membership changes
We already drop noop membership changes when they don't make it into a MELS, so we just need to make the MELS aware enough to drop messages early that are noops. Fixes https://github.com/vector-im/riot-web/issues/12575
This commit is contained in:
parent
db3721b10b
commit
d95f843cd0
1 changed files with 11 additions and 0 deletions
|
@ -962,6 +962,17 @@ class MemberGrouper {
|
|||
}
|
||||
|
||||
add(ev) {
|
||||
if (ev.getType() === 'm.room.member') {
|
||||
// We'll just double check that it's worth our time to do so...
|
||||
if (ev.getPrevContent()) {
|
||||
const membershipChange = ev.getPrevContent()['membership'] !== ev.getContent()['membership'];
|
||||
const displayNameChange = ev.getPrevContent()['displayname'] !== ev.getContent()['displayname'];
|
||||
const avatarChange = ev.getPrevContent()['avatar_url'] !== ev.getContent()['avatar_url'];
|
||||
if (!membershipChange && !displayNameChange && !avatarChange) {
|
||||
return; // Not a substantial change - quietly ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
this.readMarker = this.readMarker || this.panel._readMarkerForEvent(ev.getId());
|
||||
this.events.push(ev);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue