feat: 消息未读标记

This commit is contained in:
guozhigq
2024-02-25 19:34:24 +08:00
parent 078e4716b4
commit bf071ea9e1
4 changed files with 85 additions and 26 deletions

View File

@ -25,10 +25,31 @@ class WhisperDetailController extends GetxController {
var res = await MsgHttp.sessionMsg(talkerId: talkerId);
if (res['status']) {
messageList.value = res['data'].messages;
if (messageList.isNotEmpty && res['data'].eInfos != null) {
eInfos = res['data'].eInfos;
if (messageList.isNotEmpty) {
ackSessionMsg();
if (res['data'].eInfos != null) {
eInfos = res['data'].eInfos;
}
}
} else {
SmartDialog.showToast(res['msg']);
}
return res;
}
// 消息标记已读
Future ackSessionMsg() async {
if (messageList.isEmpty) {
return;
}
var res = await MsgHttp.ackSessionMsg(
talkerId: talkerId,
ackSeqno: messageList.last.msgSeqno,
);
if (res['status']) {
SmartDialog.showToast("已读成功");
} else {
SmartDialog.showToast(res['msg']);
}
}
}