fix msg avatar

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-15 12:47:06 +08:00
parent d6c12195f8
commit 2877372f67

View File

@@ -30,6 +30,13 @@ class WhisperSessionItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final resource =
item.sessionInfo.avatar.fallbackLayers.layers.first.resource;
final avatar = resource.hasResImage()
? resource.resImage.imageSrc.remote.url
: resource.hasResAnimation()
? resource.resAnimation.webpSrc.remote.url
: resource.resNativeDraw.drawSrc.remote.url;
Map? vipInfo = item.sessionInfo.hasVipInfo() Map? vipInfo = item.sessionInfo.hasVipInfo()
? jsonDecode(item.sessionInfo.vipInfo) ? jsonDecode(item.sessionInfo.vipInfo)
: null; : null;
@@ -100,8 +107,7 @@ class WhisperSessionItem extends StatelessWidget {
arguments: { arguments: {
'talkerId': item.id.privateId.talkerUid.toInt(), 'talkerId': item.id.privateId.talkerUid.toInt(),
'name': item.sessionInfo.sessionName, 'name': item.sessionInfo.sessionName,
'face': item.sessionInfo.avatar.fallbackLayers.layers.first 'face': avatar,
.resource.resImage.imageSrc.remote.url,
if (item.sessionInfo.avatar.hasMid()) if (item.sessionInfo.avatar.hasMid())
'mid': item.sessionInfo.avatar.mid.toInt(), 'mid': item.sessionInfo.avatar.mid.toInt(),
}, },
@@ -159,8 +165,7 @@ class WhisperSessionItem extends StatelessWidget {
child: PendantAvatar( child: PendantAvatar(
size: 42, size: 42,
badgeSize: 14, badgeSize: 14,
avatar: item.sessionInfo.avatar.fallbackLayers.layers.first avatar: avatar,
.resource.resImage.imageSrc.remote.url,
garbPendantImage: garbPendantImage:
pendant?.resImage.imageSrc.remote.hasUrl() == true pendant?.resImage.imageSrc.remote.hasUrl() == true
? pendant!.resImage.imageSrc.remote.url ? pendant!.resImage.imageSrc.remote.url