mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-27 11:38:40 +00:00
@@ -14,7 +14,8 @@ class SuperChatItem {
|
|||||||
String token;
|
String token;
|
||||||
int ts;
|
int ts;
|
||||||
UserInfo userInfo;
|
UserInfo userInfo;
|
||||||
bool expired = false;
|
late bool expired = false;
|
||||||
|
late bool deleted = false;
|
||||||
|
|
||||||
SuperChatItem({
|
SuperChatItem({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
|||||||
@@ -518,6 +518,25 @@ class LiveRoomController extends GetxController {
|
|||||||
}
|
}
|
||||||
addDm(item);
|
addDm(item);
|
||||||
break;
|
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) {
|
||||||
|
final item = superChatMsg.firstWhereOrNull((e) => e.id == id);
|
||||||
|
item?.deleted = true;
|
||||||
|
refresh ??= true;
|
||||||
|
}
|
||||||
|
if (refresh ?? false) {
|
||||||
|
superChatMsg.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case 'WATCHED_CHANGE':
|
case 'WATCHED_CHANGE':
|
||||||
watchedShow.value = obj['data']['text_large'];
|
watchedShow.value = obj['data']['text_large'];
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ class _SuperChatCardState extends State<SuperChatCard> {
|
|||||||
onSecondaryTapUp: PlatformUtils.isDesktop ? showMenu : null,
|
onSecondaryTapUp: PlatformUtils.isDesktop ? showMenu : null,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.vertical(
|
borderRadius: const .vertical(top: .circular(8)),
|
||||||
top: Radius.circular(8),
|
|
||||||
),
|
|
||||||
color: Utils.parseColor(item.backgroundColor),
|
color: Utils.parseColor(item.backgroundColor),
|
||||||
border: Border(top: border, left: border, right: border),
|
border: Border(top: border, left: border, right: border),
|
||||||
),
|
),
|
||||||
@@ -193,16 +191,22 @@ class _SuperChatCardState extends State<SuperChatCard> {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.vertical(
|
borderRadius: const .vertical(bottom: .circular(8)),
|
||||||
bottom: Radius.circular(8),
|
|
||||||
),
|
|
||||||
color: bottomColor,
|
color: bottomColor,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: SelectionArea(
|
child: SelectionArea(
|
||||||
child: Text(
|
child: Text(
|
||||||
item.message,
|
item.message,
|
||||||
style: TextStyle(color: Utils.parseColor(item.messageFontColor)),
|
style: TextStyle(
|
||||||
|
color: Utils.parseColor(item.messageFontColor),
|
||||||
|
decoration: !widget.persistentSC && item.deleted
|
||||||
|
? .lineThrough
|
||||||
|
: null,
|
||||||
|
decorationThickness: 1.5,
|
||||||
|
decorationStyle: .double,
|
||||||
|
decorationColor: Colors.white,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user