added talk notification levels for chats
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
|
||||
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
||||
|
||||
import '../../../../../api/marianumcloud/talk/actions/talk_actions.dart';
|
||||
import '../../../../../api/marianumcloud/talk/chat/get_chat_response.dart';
|
||||
import '../../../../../api/marianumcloud/talk/room/get_room_response.dart';
|
||||
import '../../../infrastructure/utility_widgets/loadable_hydrated_bloc/loadable_hydrated_bloc.dart';
|
||||
@@ -126,6 +127,18 @@ class ChatListBloc
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> setNotificationLevel(
|
||||
String token,
|
||||
GetRoomResponseObjectParticipantNotificationLevel level,
|
||||
) async {
|
||||
await SetNotificationLevel(token, level).run();
|
||||
_mutateRoom(token, (r) {
|
||||
if (r.notificationLevel == level) return false;
|
||||
r.notificationLevel = level;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/// Clears unread too — long-poll only feeds this in for an actively-open chat.
|
||||
void applyIncomingMessage(String token, GetChatResponseObject message) {
|
||||
_mutateRoom(token, (r) {
|
||||
|
||||
Reference in New Issue
Block a user