This commit is contained in:
Timothy Jaeryang Baek
2025-11-30 10:40:24 -05:00
parent 3f1d9ccbf8
commit 39645102d1
3 changed files with 35 additions and 7 deletions
+6 -3
View File
@@ -219,8 +219,8 @@ async def create_new_channel(
class ChannelFullResponse(ChannelResponse):
user_ids: Optional[list[str]] = None # 'dm' channels only
users: Optional[list[UserIdNameResponse]] = None # 'dm' channels only
user_ids: Optional[list[str]] = None # 'group'/'dm' channels only
users: Optional[list[UserIdNameStatusResponse]] = None # 'group'/'dm' channels only
last_read_at: Optional[int] = None # timestamp in epoch (time_ns)
unread_count: int = 0
@@ -246,8 +246,11 @@ async def get_channel_by_id(id: str, user=Depends(get_verified_user)):
user_ids = [
member.user_id for member in Channels.get_members_by_channel_id(channel.id)
]
users = [
UserIdNameResponse(**user.model_dump())
UserIdNameStatusResponse(
**{**user.model_dump(), "is_active": Users.is_user_active(user.id)}
)
for user in Users.get_users_by_user_ids(user_ids)
]