mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 19:28:27 +08:00
@@ -12,6 +12,7 @@ import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_danmaku/danmaku_msg.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_danmaku/live_emote.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_dm_info/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_medal_wall/uinfo_medal.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_room_play_info/codec.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_superchat/item.dart';
|
||||
@@ -37,6 +38,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -335,6 +337,10 @@ class LiveRoomController extends GetxController {
|
||||
messages.addAll(response);
|
||||
scrollToBottom();
|
||||
}
|
||||
} else {
|
||||
if (kDebugMode) {
|
||||
Utils.reportError(res.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,6 +486,7 @@ class LiveRoomController extends GetxController {
|
||||
name: extra['reply_uname'],
|
||||
);
|
||||
}
|
||||
final medal = user['medal'];
|
||||
addDm(
|
||||
DanmakuMsg(
|
||||
name: name,
|
||||
@@ -490,6 +497,7 @@ class LiveRoomController extends GetxController {
|
||||
uemote: uemote,
|
||||
extra: liveExtra,
|
||||
reply: reply,
|
||||
medalInfo: medal == null ? null : UinfoMedal.fromJson(medal),
|
||||
),
|
||||
DanmakuContentItem(
|
||||
msg,
|
||||
@@ -513,27 +521,27 @@ class LiveRoomController extends GetxController {
|
||||
}
|
||||
addDm(item);
|
||||
break;
|
||||
case 'SUPER_CHAT_MESSAGE_DELETE' when showSuperChat:
|
||||
if (obj['roomid'] == roomId) {
|
||||
final ids = obj['data']?['ids'] as List?;
|
||||
if (ids != null && ids.isNotEmpty) {
|
||||
if (superChatType == .valid) {
|
||||
superChatMsg.removeWhere((e) => ids.contains(e.id));
|
||||
} else {
|
||||
bool? refresh;
|
||||
for (final id in ids) {
|
||||
if (superChatMsg.firstWhereOrNull((e) => e.id == id)
|
||||
case final item?) {
|
||||
item.deleted = true;
|
||||
refresh ??= true;
|
||||
}
|
||||
}
|
||||
if (refresh ?? false) {
|
||||
superChatMsg.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// case 'SUPER_CHAT_MESSAGE_DELETE' when showSuperChat:
|
||||
// if (obj['roomid'] == roomId) {
|
||||
// final ids = obj['data']?['ids'] as List?;
|
||||
// if (ids != null && ids.isNotEmpty) {
|
||||
// if (superChatType == .valid) {
|
||||
// superChatMsg.removeWhere((e) => ids.contains(e.id));
|
||||
// } else {
|
||||
// bool? refresh;
|
||||
// for (final id in ids) {
|
||||
// if (superChatMsg.firstWhereOrNull((e) => e.id == id)
|
||||
// case final item?) {
|
||||
// item.deleted = true;
|
||||
// refresh ??= true;
|
||||
// }
|
||||
// }
|
||||
// if (refresh ?? false) {
|
||||
// superChatMsg.refresh();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
case 'WATCHED_CHANGE':
|
||||
watchedShow.value = obj['data']['text_large'];
|
||||
break;
|
||||
@@ -544,7 +552,11 @@ class LiveRoomController extends GetxController {
|
||||
title.value = obj['data']['title'];
|
||||
break;
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (e, s) {
|
||||
if (kDebugMode) {
|
||||
Utils.reportError(e, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final RxInt likeClickTime = 0.obs;
|
||||
|
||||
Reference in New Issue
Block a user