Merge pull request #5321 from matrix-org/travis/fix-line

Fix/clarify boolean logic for reaction previews
pull/21833/head
Travis Ralston 2020-10-14 10:08:41 -06:00 committed by GitHub
commit 7cce8a3196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -27,7 +27,13 @@ export class ReactionEventPreview implements IPreview {
const showDms = SettingsStore.getValue("feature_roomlist_preview_reactions_dms");
const showAll = SettingsStore.getValue("feature_roomlist_preview_reactions_all");
if (!showAll && (!showDms || DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) return null;
// If we're not showing all reactions, see if we're showing DMs instead
if (!showAll) {
// If we're not showing reactions on DMs, or we are and the room isn't a DM, skip
if (!(showDms && DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) {
return null;
}
}
const relation = event.getRelation();
if (!relation) return null; // invalid reaction (probably redacted)