Chat timeout APIs

🐛 Fix member listing in chat
This commit is contained in:
2025-11-30 21:08:07 +08:00
parent c038ab9e3c
commit d5510f7e4d
3 changed files with 128 additions and 6 deletions

View File

@@ -92,11 +92,10 @@ public class ChatRoomService(
.ToList();
if (directRoomsId.Count == 0) return rooms;
List<SnChatMember> members = directRoomsId.Count != 0
var members = directRoomsId.Count != 0
? await db.ChatMembers
.Where(m => directRoomsId.Contains(m.ChatRoomId))
.Where(m => m.AccountId != userId)
// Ignored the joined at condition here to keep showing userinfo when other didn't accept the invite of DM
.ToListAsync()
: [];
members = await LoadMemberAccounts(members);
@@ -122,7 +121,6 @@ public class ChatRoomService(
if (room.Type != ChatRoomType.DirectMessage) return room;
var members = await db.ChatMembers
.Where(m => m.ChatRoomId == room.Id && m.AccountId != userId)
.Where(m => m.JoinedAt != null && m.LeaveAt == null)
.ToListAsync();
if (members.Count <= 0) return room;