diff --git a/lib/pages/whisper/view.dart b/lib/pages/whisper/view.dart index 37aec09b..29877e6d 100644 --- a/lib/pages/whisper/view.dart +++ b/lib/pages/whisper/view.dart @@ -177,11 +177,16 @@ class _WhisperPageState extends State { if (content == null || content == "") { content = '不支持的消息类型'; } else { - content = content['text'] ?? + dynamic msg = content['text'] ?? content['content'] ?? content['title'] ?? - content['reply_content'] ?? - content.toString(); + content['reply_content']; + if (msg == null) { + if (content['imageType'] != null) { + msg = '[图片消息]'; + } + } + content = msg ?? content.toString(); } return ListTile( tileColor: sessionList[i].topTs == 0 diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 1ef3fa10..52ebd353 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -7,7 +7,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:PiliPlus/common/widgets/network_img_layer.dart'; import 'package:PiliPlus/utils/utils.dart'; -import 'package:PiliPlus/utils/storage.dart'; import '../../../http/search.dart'; @@ -49,13 +48,12 @@ class ChatItem extends StatelessWidget { this.item, this.eInfos, this.onLongPress, - }); + }) : isOwner = onLongPress != null; + + final bool isOwner; @override Widget build(BuildContext context) { - bool isOwner = - item.senderUid == GStorage.userInfo.get('userInfoCache')?.mid; - bool isPic = item.msgType == MsgType.pic.value; // 图片 // bool isText = item.msgType == MsgType.text.value; // 文本 // bool isArchive = item.msgType == 11; // 投稿