Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-06 14:14:19 +08:00
parent 1a8c348af1
commit 07843a5e77
239 changed files with 3175 additions and 13237 deletions

View File

@@ -4,28 +4,11 @@ import 'package:PiliPlus/grpc/bilibili/pagination.pb.dart';
import 'package:PiliPlus/grpc/grpc_req.dart';
import 'package:PiliPlus/grpc/url.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/utils/storage_pref.dart';
import 'package:fixnum/fixnum.dart';
abstract final class ReplyGrpc {
static bool antiGoodsReply = Pref.antiGoodsReply;
static RegExp replyRegExp = RegExp(
Pref.banWordForReply,
caseSensitive: false,
);
static bool enableFilter = replyRegExp.pattern.isNotEmpty;
// static Future replyInfo({required int rpid}) {
// return _request(
// GrpcUrl.replyInfo,
// ReplyInfoReq(rpid: Int64(rpid)),
// ReplyInfoReply.fromBuffer,
// onSuccess: (response) => response.reply,
// );
// }
// ref BiliRoamingX
static bool needRemoveGoodGrpc(ReplyInfo reply) {
static bool needRemoveGrpc(ReplyInfo reply) {
return (reply.content.urls.isNotEmpty &&
reply.content.urls.values.any((url) {
return url.hasExtra() &&
@@ -36,11 +19,6 @@ abstract final class ReplyGrpc {
reply.content.message.contains(Constants.goodsUrlPrefix);
}
static bool needRemoveGrpc(ReplyInfo reply) {
return (enableFilter && replyRegExp.hasMatch(reply.content.message)) ||
(antiGoodsReply && needRemoveGoodGrpc(reply));
}
static Future<LoadingState<MainListReply>> mainList({
int type = 1,
required int oid,