Add settings to hide membership and profile events

This commit is contained in:
miruka 2020-03-22 12:04:43 -04:00
parent f13327b073
commit c6390238a9
3 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,8 @@
- Redacting messages
- Download progress bar for file events, "Save as..."
- Make rooms fully manageable within Mirage: settings, permissions, kick, etc
- See about FlatPak packaging
- Add AppImage metadata file
- Pillow now bundle image libraries?
Update AppImage building script and INSTALL.md
@ -29,6 +31,8 @@
- Drop the `HBox` `buttonModel`/`buttonCallbacks` `HBox` approach,
be more declarative
- Look into Kirigami for QML
## Issues
- When zooming in enough, "Mirage <version>" label overflows

View File

@ -213,6 +213,10 @@ class NioCallbacks:
# Membership changes
if not prev or membership != prev_membership:
if self.client.backend.ui_settings["hideMembershipEvents"]:
self.client.skipped_events[room.room_id] += 1
return None
reason = f". Reason: {now['reason']}" if now.get("reason") else ""
if membership == "join":
@ -272,9 +276,9 @@ class NioCallbacks:
account.display_name = now["displayname"] or ""
account.avatar_url = now["avatar_url"] or ""
# Hide profile events from the timeline - XXX
self.client.skipped_events[room.room_id] += 1
return None
if self.client.backend.ui_settings["hideProfileChangeEvents"]:
self.client.skipped_events[room.room_id] += 1
return None
return (
TypeSpecifier.ProfileChange,

View File

@ -211,6 +211,8 @@ class UISettings(JSONDataFile):
"clearRoomFilterOnEnter": True,
"clearRoomFilterOnEscape": True,
"collapseSidePanesUnderWindowWidth": 400,
"hideProfileChangeEvents": True,
"hideMembershipEvents": False,
"theme": "Midnight.qpl",
"writeAliases": {},
"media": {