From f467532f9d1580710178bb458181535d603c7e76 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 5 Jan 2025 11:24:12 +0800 Subject: [PATCH] opt: whisper data Signed-off-by: bggRGjQaUbCoE --- lib/models/msg/account.dart | 2 +- lib/models/msg/session.dart | 4 ++++ lib/pages/whisper/controller.dart | 8 +------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/models/msg/account.dart b/lib/models/msg/account.dart index bedd49b5..16318d5d 100644 --- a/lib/models/msg/account.dart +++ b/lib/models/msg/account.dart @@ -55,7 +55,7 @@ class AccountListModel { mid = json['mid']; name = json['name'] ?? ''; sex = json['sex']; - face = json['face']; + face = json['face'] ?? json['pic_url']; sign = json['sign']; rank = json['rank']; level = json['level']; diff --git a/lib/models/msg/session.dart b/lib/models/msg/session.dart index 93f8ba19..9218c62d 100644 --- a/lib/models/msg/session.dart +++ b/lib/models/msg/session.dart @@ -47,6 +47,7 @@ class SessionList { this.liveStatus, this.bizMsgUnreadCount, // this.userLabel, + this.accountInfo, }); int? talkerId; @@ -105,6 +106,9 @@ class SessionList { liveStatus = json["live_status"]; bizMsgUnreadCount = json["biz_msg_unread_count"]; // userLabel = json["user_label"]; + accountInfo = json['account_info'] == null + ? null + : AccountListModel.fromJson(json['account_info']); } } diff --git a/lib/pages/whisper/controller.dart b/lib/pages/whisper/controller.dart index f20490b7..91a4ba98 100644 --- a/lib/pages/whisper/controller.dart +++ b/lib/pages/whisper/controller.dart @@ -117,13 +117,7 @@ class WhisperController extends GetxController { if (accountInfo != null) { i.accountInfo = accountInfo; } - if (i.talkerId == 0) { - i.accountInfo = AccountListModel( - name: '客服消息', - face: - 'https://i0.hdslb.com/bfs/activity-plat/static/20230809/f87fc7ea98282a4dd48ec7743044b0bf/OWdoP9ZXAX.png', - ); - } else if (i.talkerId == 844424930131966) { + if (i.talkerId == 844424930131966) { i.accountInfo = AccountListModel( name: 'UP主小助手', face: