mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
reply/dyn appeal
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -213,7 +213,6 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
void onCheckReply(BuildContext context, ReplyInfo replyInfo,
|
void onCheckReply(BuildContext context, ReplyInfo replyInfo,
|
||||||
{required bool isManual}) {
|
{required bool isManual}) {
|
||||||
ReplyUtils.onCheckReply(
|
ReplyUtils.onCheckReply(
|
||||||
context: context,
|
|
||||||
replyInfo: replyInfo,
|
replyInfo: replyInfo,
|
||||||
biliSendCommAntifraud: _biliSendCommAntifraud,
|
biliSendCommAntifraud: _biliSendCommAntifraud,
|
||||||
sourceId: sourceId,
|
sourceId: sourceId,
|
||||||
|
|||||||
@@ -1158,7 +1158,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
leading: const Icon(Icons.save_alt, size: 19),
|
leading: const Icon(Icons.save_alt, size: 19),
|
||||||
title: Text('保存评论', style: style),
|
title: Text('保存评论', style: style),
|
||||||
),
|
),
|
||||||
if (item.mid == ownerMid)
|
if (kDebugMode || item.mid == ownerMid)
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () => menuActionHandler('checkReply'),
|
onTap: () => menuActionHandler('checkReply'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
|
|||||||
@@ -9,15 +9,16 @@ import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
|||||||
import 'package:PiliPlus/models_new/reply/data.dart';
|
import 'package:PiliPlus/models_new/reply/data.dart';
|
||||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class ReplyUtils {
|
class ReplyUtils {
|
||||||
static void onCheckReply({
|
static void onCheckReply({
|
||||||
required BuildContext context,
|
|
||||||
required ReplyInfo replyInfo,
|
required ReplyInfo replyInfo,
|
||||||
required bool biliSendCommAntifraud,
|
required bool biliSendCommAntifraud,
|
||||||
required sourceId,
|
required sourceId,
|
||||||
@@ -25,7 +26,6 @@ class ReplyUtils {
|
|||||||
}) {
|
}) {
|
||||||
try {
|
try {
|
||||||
_checkReply(
|
_checkReply(
|
||||||
context: context,
|
|
||||||
oid: replyInfo.oid.toInt(),
|
oid: replyInfo.oid.toInt(),
|
||||||
type: replyInfo.type.toInt(),
|
type: replyInfo.type.toInt(),
|
||||||
id: replyInfo.id.toInt(),
|
id: replyInfo.id.toInt(),
|
||||||
@@ -50,7 +50,6 @@ class ReplyUtils {
|
|||||||
|
|
||||||
// ref https://github.com/freedom-introvert/biliSendCommAntifraud
|
// ref https://github.com/freedom-introvert/biliSendCommAntifraud
|
||||||
static Future<void> _checkReply({
|
static Future<void> _checkReply({
|
||||||
required BuildContext context,
|
|
||||||
required int oid,
|
required int oid,
|
||||||
required int type,
|
required int type,
|
||||||
required int id,
|
required int id,
|
||||||
@@ -99,19 +98,42 @@ class ReplyUtils {
|
|||||||
if (!isManual) {
|
if (!isManual) {
|
||||||
await Future.delayed(const Duration(seconds: 8));
|
await Future.delayed(const Duration(seconds: 8));
|
||||||
}
|
}
|
||||||
void showReplyCheckResult(String message) {
|
void showReplyCheckResult(String message, {bool isBan = false}) {
|
||||||
if (context.mounted) {
|
Get.dialog(
|
||||||
showDialog(
|
AlertDialog(
|
||||||
context: context,
|
title: const Text('评论检查结果'),
|
||||||
builder: (context) => AlertDialog(
|
content: SelectableText(message),
|
||||||
title: const Text('评论检查结果'),
|
actions: isBan
|
||||||
content: SelectableText(message),
|
? [
|
||||||
),
|
TextButton(
|
||||||
);
|
onPressed: () {
|
||||||
}
|
Get.back();
|
||||||
|
String? uri;
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
uri = IdUtils.av2bv(oid);
|
||||||
|
case 17:
|
||||||
|
uri = 'https://www.bilibili.com/opus/$oid';
|
||||||
|
}
|
||||||
|
if (uri != null) {
|
||||||
|
Utils.copyText(uri);
|
||||||
|
}
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url':
|
||||||
|
'https://www.bilibili.com/h5/comment/appeal?native.theme=2&night=${Get.isDarkMode ? 1 : 0}'
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: const Text('申诉'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!context.mounted) return;
|
|
||||||
// root reply
|
// root reply
|
||||||
if (root == 0) {
|
if (root == 0) {
|
||||||
// no cookie check
|
// no cookie check
|
||||||
@@ -125,7 +147,7 @@ class ReplyUtils {
|
|||||||
enableFilter: false,
|
enableFilter: false,
|
||||||
antiGoodsReply: false,
|
antiGoodsReply: false,
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
|
||||||
if (res is Error) {
|
if (res is Error) {
|
||||||
SmartDialog.showToast('获取评论主列表时发生错误:${res.errMsg}');
|
SmartDialog.showToast('获取评论主列表时发生错误:${res.errMsg}');
|
||||||
return;
|
return;
|
||||||
@@ -138,7 +160,7 @@ class ReplyUtils {
|
|||||||
showReplyCheckResult('无账号状态下找到了你的评论,评论正常!\n\n你的评论:$message');
|
showReplyCheckResult('无账号状态下找到了你的评论,评论正常!\n\n你的评论:$message');
|
||||||
} else {
|
} else {
|
||||||
// not found
|
// not found
|
||||||
if (!context.mounted) return;
|
|
||||||
// cookie check
|
// cookie check
|
||||||
final res1 = await ReplyHttp.replyReplyList(
|
final res1 = await ReplyHttp.replyReplyList(
|
||||||
isLogin: true,
|
isLogin: true,
|
||||||
@@ -149,13 +171,13 @@ class ReplyUtils {
|
|||||||
filterBanWord: false,
|
filterBanWord: false,
|
||||||
antiGoodsReply: false,
|
antiGoodsReply: false,
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
|
||||||
if (res1 is Error) {
|
if (res1 is Error) {
|
||||||
// not found
|
// not found
|
||||||
showReplyCheckResult('无法找到你的评论。\n\n你的评论:$message');
|
showReplyCheckResult('无法找到你的评论。\n\n你的评论:$message', isBan: true);
|
||||||
} else {
|
} else {
|
||||||
// found
|
// found
|
||||||
if (!context.mounted) return;
|
|
||||||
// no cookie check
|
// no cookie check
|
||||||
final res2 = await ReplyHttp.replyReplyList(
|
final res2 = await ReplyHttp.replyReplyList(
|
||||||
isLogin: false,
|
isLogin: false,
|
||||||
@@ -167,13 +189,14 @@ class ReplyUtils {
|
|||||||
isCheck: true,
|
isCheck: true,
|
||||||
antiGoodsReply: false,
|
antiGoodsReply: false,
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
|
||||||
if (res2 is Error) {
|
if (res2 is Error) {
|
||||||
// not found
|
// not found
|
||||||
showReplyCheckResult(
|
showReplyCheckResult(
|
||||||
res2.errMsg?.startsWith('12022') == true
|
res2.errMsg?.startsWith('12022') == true
|
||||||
? '你的评论被shadow ban(仅自己可见)!\n\n你的评论: $message'
|
? '你的评论被shadow ban(仅自己可见)!\n\n你的评论: $message'
|
||||||
: '评论不可见(${res2.errMsg}): $message',
|
: '评论不可见(${res2.errMsg}): $message',
|
||||||
|
isBan: true,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// found
|
// found
|
||||||
@@ -191,7 +214,6 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=$id&type=$typ
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 1;; i++) {
|
for (int i = 1;; i++) {
|
||||||
if (!context.mounted) return;
|
|
||||||
final res3 = await ReplyHttp.replyReplyList(
|
final res3 = await ReplyHttp.replyReplyList(
|
||||||
isLogin: false,
|
isLogin: false,
|
||||||
oid: oid,
|
oid: oid,
|
||||||
@@ -221,7 +243,6 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=$id&type=$typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1;; i++) {
|
for (int i = 1;; i++) {
|
||||||
if (!context.mounted) return;
|
|
||||||
final res4 = await ReplyHttp.replyReplyList(
|
final res4 = await ReplyHttp.replyReplyList(
|
||||||
isLogin: true,
|
isLogin: true,
|
||||||
oid: oid,
|
oid: oid,
|
||||||
@@ -244,13 +265,16 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=$id&type=$typ
|
|||||||
// not found
|
// not found
|
||||||
} else {
|
} else {
|
||||||
// found
|
// found
|
||||||
showReplyCheckResult('你的评论被shadow ban(仅自己可见)!\n\n你的评论: $message');
|
showReplyCheckResult(
|
||||||
|
'你的评论被shadow ban(仅自己可见)!\n\n你的评论: $message',
|
||||||
|
isBan: true,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showReplyCheckResult('评论不可见: $message');
|
showReplyCheckResult('评论不可见: $message', isBan: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import 'package:PiliPlus/pages/group_panel/view.dart';
|
|||||||
import 'package:PiliPlus/pages/later/controller.dart';
|
import 'package:PiliPlus/pages/later/controller.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
@@ -294,12 +295,30 @@ class RequestUtils {
|
|||||||
await Future.delayed(const Duration(seconds: 5));
|
await Future.delayed(const Duration(seconds: 5));
|
||||||
}
|
}
|
||||||
var res = await DynamicsHttp.dynamicDetail(id: id, clearCookie: true);
|
var res = await DynamicsHttp.dynamicDetail(id: id, clearCookie: true);
|
||||||
showDialog(
|
bool isBan = !res['status'];
|
||||||
context: Get.context!,
|
Get.dialog(
|
||||||
builder: (context) => AlertDialog(
|
AlertDialog(
|
||||||
title: const Text('动态检查结果'),
|
title: const Text('动态检查结果'),
|
||||||
content: SelectableText(
|
content: SelectableText(
|
||||||
'${res['status'] ? '无账号状态下找到了你的动态,动态正常!' : '你的动态被shadow ban(仅自己可见)!'}${dynText != null ? ' \n\n动态内容: $dynText' : ''}'),
|
'${!isBan ? '无账号状态下找到了你的动态,动态正常!' : '你的动态被shadow ban(仅自己可见)!'}${dynText != null ? ' \n\n动态内容: $dynText' : ''}'),
|
||||||
|
actions: isBan
|
||||||
|
? [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Utils.copyText('https://www.bilibili.com/opus/$id');
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url':
|
||||||
|
'https://www.bilibili.com/h5/comment/appeal?native.theme=2&night=${Get.isDarkMode ? 1 : 0}'
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: const Text('申诉'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// ignore_for_file: constant_identifier_names
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|||||||
Reference in New Issue
Block a user