Added Chat context menu for chat 'mark as read', 'mark as unread', 'add to favorites', 'remove from favorites', 'leave conversation'

added Chat favorite badge and mark chat as read when entering it
This commit is contained in:
2023-06-04 18:28:15 +02:00
parent 16c251e4b1
commit 4ef21a362b
7 changed files with 239 additions and 24 deletions

View File

@ -0,0 +1,27 @@
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import '../talkApi.dart';
class SetFavorite extends TalkApi<void> {
String chatToken;
bool favoriteState;
SetFavorite(this.chatToken, this.favoriteState) : super("v4/room/$chatToken/favorite", null);
@override
assemble(String raw) {
}
@override
Future<Response> request(Uri uri, Object? body, Map<String, String>? headers) {
if(favoriteState) {
return http.post(uri, headers: headers);
} else {
return http.delete(uri, headers: headers);
}
}
}