diff --git a/lib/app_config.dart b/lib/app_config.dart index 35f7c5fa..9869354d 100644 --- a/lib/app_config.dart +++ b/lib/app_config.dart @@ -16,6 +16,7 @@ abstract class AppConfig { static bool renderHtml = false; static bool hideRedactedEvents = false; static bool hideUnknownEvents = false; + static const bool hideAllStateEvents = false; static const String inviteLinkPrefix = 'https://matrix.to/#/'; static const String pushNotificationsChannelId = 'fluffychat_push'; static const String pushNotificationsChannelName = 'FluffyChat push channel'; diff --git a/lib/components/list_items/state_message.dart b/lib/components/list_items/state_message.dart index 917ea96d..b939a275 100644 --- a/lib/components/list_items/state_message.dart +++ b/lib/components/list_items/state_message.dart @@ -3,13 +3,17 @@ import 'package:fluffychat/utils/matrix_locals.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import '../../app_config.dart'; + class StateMessage extends StatelessWidget { final Event event; const StateMessage(this.event); @override Widget build(BuildContext context) { - if (event.type == EventTypes.Redaction) return Container(); + if (event.type == EventTypes.Redaction || AppConfig.hideAllStateEvents) { + return Container(); + } return Padding( padding: const EdgeInsets.only( left: 8.0,