feat: make showing user presence info optional
895de76e70 replaced the stories feature
with presence status messages. Stories were an optional feature but
right now presence information can only be disabled on a homeserver
level.
Introduce a setting to make this feature optional on a client level.
This commit is contained in:
parent
aa68e8fe3b
commit
ccfa3fa8f6
6 changed files with 37 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import 'package:animations/animations.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
|
||||
import 'package:fluffychat/pages/chat_list/search_title.dart';
|
||||
|
|
@ -131,7 +132,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
if (!controller.isSearchMode &&
|
||||
controller.activeFilter != ActiveFilter.groups)
|
||||
controller.activeFilter != ActiveFilter.groups &&
|
||||
AppConfig.showPresences)
|
||||
StatusMessageList(
|
||||
onStatusEdit: controller.setStatus,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/utils/account_config.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
|
|
@ -9,6 +10,7 @@ import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
|||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||
import '../../config/app_config.dart';
|
||||
import '../../widgets/settings_switch_list_tile.dart';
|
||||
import 'settings_style.dart';
|
||||
|
||||
class SettingsStyleView extends StatelessWidget {
|
||||
|
|
@ -162,6 +164,22 @@ class SettingsStyleView extends StatelessWidget {
|
|||
onChanged: controller.switchTheme,
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.presenceStyle,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context)!.presencesToggle,
|
||||
onChanged: (b) => AppConfig.showPresences = b,
|
||||
storeKey: SettingKeys.showPresences,
|
||||
defaultValue: AppConfig.showPresences,
|
||||
),
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.messagesStyle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue