Browse Source

chat add conversation ,database query change userId to conversationId

wr_202303
zsw 4 months ago
parent
commit
6867bb83ec
  1. 1
      lib/im/chat_details_page.dart
  2. 10
      lib/im/im_view/im_page.dart

1
lib/im/chat_details_page.dart

@ -330,6 +330,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
setState(() {
needShowSmiley = false;
emojiShowing = false;
isKeyBoardShow = emojiShowing;
moreShow = false;

10
lib/im/im_view/im_page.dart

@ -102,7 +102,7 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
listenerRefresh(Message message) async {
await sortConversation(lastMessageMap);
await queryUnreadCount(conversationId);
await queryUnreadCount(conversationIds);
debugPrint("messages_records : ${message.toJson()}");
if (contactMap[message.fromId] == null) {
@ -134,14 +134,11 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
.map((e) => e.conversationId)
.toSet()
.toList();
conversationIds.forEach((element) {
debugPrint("conversationIds: ${element}");
});
}
/// update conversation unreadcount
queryUnreadCount(conversationId) async {
unreadCountMap = await hxDatabase.messageUnreadCount(conversationId);
queryUnreadCount(conversationIds) async {
unreadCountMap = await hxDatabase.messageUnreadCount(conversationIds);
}
/// update imuser info by mids
@ -366,7 +363,6 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
children: conversationIds.map((e) {
debugPrint("---conversationIds: ${e}");
int position = conversationIds.indexOf(e);
return ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(4)),

Loading…
Cancel
Save