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