Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
d8dbc316fa
1 changed files with 7 additions and 5 deletions
|
@ -38,18 +38,20 @@ function memberEventDiff(ev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function shouldHideEvent(ev) {
|
export default function shouldHideEvent(ev) {
|
||||||
// Wrap getValue() for readability
|
// Wrap getValue() for readability. Calling the SettingsStore can be
|
||||||
|
// fairly resource heavy, so the checks below should avoid hitting it
|
||||||
|
// where possible.
|
||||||
const isEnabled = (name) => SettingsStore.getValue(name, ev.getRoomId());
|
const isEnabled = (name) => SettingsStore.getValue(name, ev.getRoomId());
|
||||||
|
|
||||||
// Hide redacted events
|
// Hide redacted events
|
||||||
if (isEnabled('hideRedactions') && ev.isRedacted()) return true;
|
if (ev.isRedacted() && isEnabled('hideRedactions')) return true;
|
||||||
|
|
||||||
const eventDiff = memberEventDiff(ev);
|
const eventDiff = memberEventDiff(ev);
|
||||||
|
|
||||||
if (eventDiff.isMemberEvent) {
|
if (eventDiff.isMemberEvent) {
|
||||||
if (isEnabled('hideJoinLeaves') && (eventDiff.isJoin || eventDiff.isPart)) return true;
|
if ((eventDiff.isJoin || eventDiff.isPart) && isEnabled('hideJoinLeaves')) return true;
|
||||||
if (isEnabled('hideAvatarChanges') && eventDiff.isAvatarChange) return true;
|
if (eventDiff.isAvatarChange && isEnabled('hideAvatarChanges')) return true;
|
||||||
if (isEnabled('hideDisplaynameChanges') && eventDiff.isDisplaynameChange) return true;
|
if (eventDiff.isDisplaynameChange && isEnabled('hideDisplaynameChanges')) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue