mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: filter reply
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -21,6 +21,7 @@ class ReplyHttp {
|
||||
required int type,
|
||||
required int page,
|
||||
int sort = 1,
|
||||
required String banWordForReply,
|
||||
}) async {
|
||||
Options? options = !isLogin
|
||||
? Options(
|
||||
@@ -51,7 +52,6 @@ class ReplyHttp {
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
ReplyData replyData = ReplyData.fromJson(res.data['data']);
|
||||
String banWordForReply = GStorage.banWordForReply;
|
||||
if (banWordForReply.isNotEmpty) {
|
||||
// topReplies
|
||||
if (replyData.topReplies?.isNotEmpty == true) {
|
||||
@@ -97,11 +97,11 @@ class ReplyHttp {
|
||||
int type = 1,
|
||||
required int oid,
|
||||
required CursorReq cursor,
|
||||
required String banWordForReply,
|
||||
}) async {
|
||||
dynamic res = await GrpcRepo.mainList(type: type, oid: oid, cursor: cursor);
|
||||
if (res['status']) {
|
||||
MainListReply mainListReply = res['data'];
|
||||
String banWordForReply = GStorage.banWordForReply;
|
||||
if (banWordForReply.isNotEmpty) {
|
||||
// upTop
|
||||
if (mainListReply.hasUpTop() &&
|
||||
@@ -139,6 +139,7 @@ class ReplyHttp {
|
||||
required int pageNum,
|
||||
required int type,
|
||||
int sort = 1,
|
||||
required String banWordForReply,
|
||||
}) async {
|
||||
Options? options = GStorage.userInfo.get('userInfoCache') == null
|
||||
? Options(
|
||||
@@ -158,7 +159,6 @@ class ReplyHttp {
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
ReplyReplyData replyData = ReplyReplyData.fromJson(res.data['data']);
|
||||
String banWordForReply = GStorage.banWordForReply;
|
||||
if (banWordForReply.isNotEmpty) {
|
||||
if (replyData.replies?.isNotEmpty == true) {
|
||||
replyData.replies!.removeWhere((item) =>
|
||||
@@ -178,6 +178,7 @@ class ReplyHttp {
|
||||
required int root,
|
||||
required int rpid,
|
||||
required CursorReq cursor,
|
||||
required String banWordForReply,
|
||||
}) async {
|
||||
dynamic res = await GrpcRepo.detailList(
|
||||
type: type,
|
||||
@@ -188,7 +189,6 @@ class ReplyHttp {
|
||||
);
|
||||
if (res['status']) {
|
||||
DetailListReply detailListReply = res['data'];
|
||||
String banWordForReply = GStorage.banWordForReply;
|
||||
if (banWordForReply.isNotEmpty) {
|
||||
if (detailListReply.root.replies.isNotEmpty) {
|
||||
detailListReply.root.replies.removeWhere((item) =>
|
||||
@@ -208,6 +208,7 @@ class ReplyHttp {
|
||||
required int root,
|
||||
required int rpid,
|
||||
required CursorReq cursor,
|
||||
required String banWordForReply,
|
||||
}) async {
|
||||
dynamic res = await GrpcRepo.dialogList(
|
||||
type: type,
|
||||
@@ -218,7 +219,6 @@ class ReplyHttp {
|
||||
);
|
||||
if (res['status']) {
|
||||
DialogListReply dialogListReply = res['data'];
|
||||
String banWordForReply = GStorage.banWordForReply;
|
||||
if (banWordForReply.isNotEmpty) {
|
||||
if (dialogListReply.replies.isNotEmpty) {
|
||||
dialogListReply.replies.removeWhere((item) =>
|
||||
|
||||
@@ -33,6 +33,8 @@ abstract class ReplyController extends CommonController {
|
||||
late Mode mode = Mode.MAIN_LIST_HOT;
|
||||
bool hasUpTop = false;
|
||||
|
||||
late final banWordForReply = GStorage.banWordForReply;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
@@ -47,6 +47,7 @@ class DynamicDetailController extends ReplyController {
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode,
|
||||
),
|
||||
banWordForReply: banWordForReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
@@ -55,5 +56,6 @@ class DynamicDetailController extends ReplyController {
|
||||
type: type!,
|
||||
sort: sortType.index,
|
||||
page: currentPage,
|
||||
banWordForReply: banWordForReply,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ class HtmlRenderController extends ReplyController {
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode,
|
||||
),
|
||||
banWordForReply: banWordForReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
@@ -65,5 +66,6 @@ class HtmlRenderController extends ReplyController {
|
||||
type: type,
|
||||
sort: sortType.index,
|
||||
page: currentPage,
|
||||
banWordForReply: banWordForReply,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class VideoReplyController extends ReplyController {
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode,
|
||||
),
|
||||
banWordForReply: banWordForReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
@@ -35,5 +36,6 @@ class VideoReplyController extends ReplyController {
|
||||
type: ReplyType.video.index,
|
||||
sort: sortType.index,
|
||||
page: currentPage,
|
||||
banWordForReply: banWordForReply,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ class VideoReplyReplyController extends CommonController
|
||||
|
||||
late final horizontalPreview = GStorage.horizontalPreview;
|
||||
|
||||
late final banWordForReply = GStorage.banWordForReply;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -186,6 +188,7 @@ class VideoReplyReplyController extends CommonController
|
||||
next: cursor?.next,
|
||||
mode: mode.value,
|
||||
),
|
||||
banWordForReply: banWordForReply,
|
||||
)
|
||||
: GlobalData().grpcReply
|
||||
? ReplyHttp.replyReplyListGrpc(
|
||||
@@ -197,12 +200,14 @@ class VideoReplyReplyController extends CommonController
|
||||
next: cursor?.next,
|
||||
mode: mode.value,
|
||||
),
|
||||
banWordForReply: banWordForReply,
|
||||
)
|
||||
: ReplyHttp.replyReplyList(
|
||||
oid: oid!,
|
||||
root: rpid!,
|
||||
pageNum: currentPage,
|
||||
type: replyType.index,
|
||||
banWordForReply: banWordForReply,
|
||||
);
|
||||
|
||||
queryBySort() {
|
||||
|
||||
Reference in New Issue
Block a user