From e464a0b922a98595e3d64e4700aa7c94af85469d Mon Sep 17 00:00:00 2001 From: krawieck Date: Fri, 14 Aug 2020 14:41:35 +0200 Subject: [PATCH] Implement `getReplies` --- lib/client/v1/user_endpoint.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/client/v1/user_endpoint.dart b/lib/client/v1/user_endpoint.dart index 567f9b1..290c97a 100644 --- a/lib/client/v1/user_endpoint.dart +++ b/lib/client/v1/user_endpoint.dart @@ -100,10 +100,20 @@ extension UserEndpoint on V1 { int limit, @required bool unreadOnly, @required String auth, - }) { + }) async { assert(sort != null); assert(unreadOnly != null); assert(auth != null); + + var res = await get('/user/replies', { + 'sort': sort.value, + if (page != null) 'page': page.toString(), + if (limit != null) 'limit': limit.toString(), + 'unread_only': unreadOnly.toString(), + 'auth': auth, + }); + List replies = res['replies']; + return replies.map((e) => ReplyView.fromJson(e)).toList(); } /// GET /user/mentions