mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 00:28:38 +00:00
tweaks (#1846)
* opt: live extra * opt: remove addPointer * opt: use ssd * opt: cache svg * opt: localToGlobal * opt: disabled icon * opt: onVideoDetailChange switch * fix --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
4a3d827f7a
commit
e707764f84
@@ -182,12 +182,12 @@ class LiveRoomController extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
scrollController = ScrollController()..addListener(listener);
|
||||
final account = Accounts.heartbeat;
|
||||
final account = Accounts.main;
|
||||
isLogin = account.isLogin;
|
||||
mid = account.mid;
|
||||
queryLiveUrl();
|
||||
queryLiveInfoH5();
|
||||
if (isLogin && !Pref.historyPause) {
|
||||
if (Accounts.heartbeat.isLogin && !Pref.historyPause) {
|
||||
VideoHttp.roomEntryAction(roomId: roomId);
|
||||
}
|
||||
if (showSuperChat) {
|
||||
@@ -428,7 +428,7 @@ class LiveRoomController extends GetxController {
|
||||
LiveMessageStream(
|
||||
streamToken: info.token!,
|
||||
roomId: roomId,
|
||||
uid: mid,
|
||||
uid: Accounts.heartbeat.mid,
|
||||
servers: info.hostList!
|
||||
.map((host) => 'wss://${host.host}:${host.wssPort}/sub')
|
||||
.toList(),
|
||||
@@ -488,7 +488,6 @@ class LiveRoomController extends GetxController {
|
||||
addDm(
|
||||
DanmakuMsg(
|
||||
name: name,
|
||||
uid: uid,
|
||||
text: msg,
|
||||
emots: (extra['emots'] as Map<String, dynamic>?)?.map(
|
||||
(k, v) => MapEntry(k, BaseEmote.fromJson(v)),
|
||||
@@ -574,7 +573,7 @@ class LiveRoomController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> onLike() async {
|
||||
if (!Accounts.main.isLogin) {
|
||||
if (!isLogin) {
|
||||
likeClickTime.value = 0;
|
||||
return;
|
||||
}
|
||||
@@ -593,7 +592,7 @@ class LiveRoomController extends GetxController {
|
||||
}
|
||||
|
||||
void onSendDanmaku([bool fromEmote = false]) {
|
||||
if (!Accounts.main.isLogin) {
|
||||
if (!isLogin) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
@@ -623,7 +622,7 @@ class LiveRoomController extends GetxController {
|
||||
}
|
||||
|
||||
void reportSC(SuperChatItem item) {
|
||||
if (!Accounts.main.isLogin) {
|
||||
if (!isLogin) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -714,7 +714,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
..savedDanmaku = [
|
||||
RichTextItem.fromStart(
|
||||
'@${item.name} ',
|
||||
rawText: item.uid.toString(),
|
||||
rawText: item.extra.mid.toString(),
|
||||
type: .at,
|
||||
id: item.extra.id.toString(),
|
||||
),
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:PiliPlus/models_new/live/live_superchat/item.dart';
|
||||
import 'package:PiliPlus/pages/live_room/controller.dart';
|
||||
import 'package:PiliPlus/pages/live_room/superchat/superchat_card.dart';
|
||||
import 'package:PiliPlus/pages/video/widgets/header_control.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
@@ -82,7 +81,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
color: nameColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
recognizer: item.uid == 0
|
||||
recognizer: item.extra.mid == 0
|
||||
? null
|
||||
: (NoDeadlineTapGestureRecognizer()
|
||||
..onTapUp = (e) => _showMsgMenu(
|
||||
@@ -292,7 +291,11 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
) {
|
||||
final dx = details.globalPosition.dx;
|
||||
final renderBox = itemContext.findRenderObject() as RenderBox;
|
||||
final dy = renderBox.localToGlobal(renderBox.size.bottomLeft(.zero)).dy;
|
||||
final dy =
|
||||
details.globalPosition.dy -
|
||||
details.localPosition.dy +
|
||||
renderBox.size.height -
|
||||
4; // padding
|
||||
final autoScroll =
|
||||
liveRoomController.autoScroll &&
|
||||
!liveRoomController.disableAutoScroll.value;
|
||||
@@ -321,7 +324,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
),
|
||||
PopupMenuItem(
|
||||
height: 38,
|
||||
onTap: () => Get.toNamed('/member?mid=${item.uid}'),
|
||||
onTap: () => Get.toNamed('/member?mid=${item.extra.mid}'),
|
||||
child: const Text(
|
||||
'去TA的个人空间',
|
||||
style: TextStyle(fontSize: 13),
|
||||
@@ -338,9 +341,9 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
PopupMenuItem(
|
||||
height: 38,
|
||||
onTap: () async {
|
||||
if (!Accounts.main.isLogin) return;
|
||||
if (!liveRoomController.isLogin) return;
|
||||
final res = await LiveHttp.liveShieldUser(
|
||||
uid: item.uid,
|
||||
uid: item.extra.mid,
|
||||
roomid: roomId,
|
||||
type: 1,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user