diff --git a/lib/models/msg/session.dart b/lib/models/msg/session.dart index 7b1aee6b..514c5c39 100644 --- a/lib/models/msg/session.dart +++ b/lib/models/msg/session.dart @@ -111,7 +111,7 @@ class SessionList { class LastMsg { LastMsg({ - this.senderIid, + this.senderUid, this.receiverType, this.receiverId, this.msgType, @@ -125,7 +125,7 @@ class LastMsg { // this.newFaceVersion, }); - int? senderIid; + int? senderUid; int? receiverType; int? receiverId; int? msgType; @@ -139,7 +139,7 @@ class LastMsg { // int? newFaceVersion; LastMsg.fromJson(Map json) { - senderIid = json['sender_uid']; + senderUid = json['sender_uid']; receiverType = json['receiver_type']; receiverId = json['receiver_id']; msgType = json['msg_type']; diff --git a/lib/pages/whisper/view.dart b/lib/pages/whisper/view.dart index ee8a8f66..e0223f5f 100644 --- a/lib/pages/whisper/view.dart +++ b/lib/pages/whisper/view.dart @@ -6,6 +6,7 @@ import 'package:pilipala/common/skeleton/skeleton.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/no_data.dart'; +import 'package:pilipala/utils/global_data_cache.dart'; import 'package:pilipala/utils/utils.dart'; import 'controller.dart'; @@ -236,6 +237,7 @@ class SessionItem extends StatelessWidget { final content = sessionItem.lastMsg.content; final msgStatus = sessionItem.lastMsg.msgStatus; final int msgType = sessionItem.lastMsg.msgType; + final int senderUid = sessionItem.lastMsg.senderUid; return ListTile( onTap: () { @@ -269,7 +271,7 @@ class SessionItem extends StatelessWidget { title: Text(sessionItem.accountInfo?.name ?? ''), subtitle: Text( msgStatus == 1 - ? '你撤回了一条消息' + ? '${senderUid == GlobalDataCache.userInfo?.mid ? '你' : '对方'}撤回了一条消息' : msgType == 2 ? '[图片]' : content != null && content != ''