added talk notification levels for chats

This commit is contained in:
2026-09-25 17:04:10 +02:00
parent e21560ed3d
commit ef7d17033d
9 changed files with 281 additions and 0 deletions
@@ -6,6 +6,7 @@ import '../../../../api/marianumcloud/talk/get_participants/get_participants_cac
import '../../../../api/marianumcloud/talk/get_participants/get_participants_response.dart';
import '../../../../api/marianumcloud/talk/get_shared_items/get_shared_items_overview_response.dart';
import '../../../../api/marianumcloud/talk/room/get_room_response.dart';
import '../../../../api/marianumcloud/talk/room/notification_level.dart';
import '../../../../state/app/modules/chat_list/bloc/chat_list_bloc.dart';
import '../../../../widget/app_progress_indicator.dart';
import '../../../../widget/async_action_button.dart';
@@ -14,6 +15,7 @@ import '../../../../widget/confirm_dialog.dart';
import '../../../../widget/large_profile_picture_view.dart';
import '../../../../widget/user_avatar.dart';
import '../talk_navigator.dart';
import '../widgets/notification_level_sheet.dart';
import 'participants_list_view.dart';
import 'shared_items_view.dart';
@@ -29,6 +31,7 @@ class _ChatInfoState extends State<ChatInfo> {
GetParticipantsResponse? participants;
GetSharedItemsOverviewResponse? _sharesOverview;
late bool _isFavorite;
late NotificationLevel _notificationLevel;
int _avatarVersion = 0;
bool _avatarBusy = false;
@@ -36,6 +39,7 @@ class _ChatInfoState extends State<ChatInfo> {
void initState() {
super.initState();
_isFavorite = widget.room.isFavorite;
_notificationLevel = widget.room.effectiveNotificationLevel;
GetParticipantsCache(
chatToken: widget.room.token,
onUpdate: (GetParticipantsResponse data) {
@@ -67,6 +71,16 @@ class _ChatInfoState extends State<ChatInfo> {
_refreshList();
}
Future<void> _editNotificationLevel() async {
final level = await showNotificationLevelSheet(
context,
widget.room,
current: _notificationLevel,
);
if (level == null || !mounted) return;
setState(() => _notificationLevel = level);
}
Future<void> _confirmLeave() async {
final closed = await showDialog<bool>(
context: context,
@@ -243,6 +257,11 @@ class _ChatInfoState extends State<ChatInfo> {
title: const Text('Zu Favoriten hinzufügen'),
onPressed: _toggleFavorite,
),
NotificationLevelTile(
level: _notificationLevel,
trailing: const Icon(Icons.arrow_right),
onTap: _editNotificationLevel,
),
const Divider(),
ListTile(
leading: Icon(