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

View File

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

View File

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