fix(channel): enforce read-only for members and polish chat info
Some checks failed
CI / test (push) Failing after 26s

- block send/forward in channels for member role on backend
- expose my_role in chat payload for client-side permissions
- hide message composer for channel members and show read-only notice
- hide members management sections for private/saved chats in info panel
- return enriched chat detail via serialize_chat_for_user
This commit is contained in:
2026-03-08 02:07:37 +03:00
parent e6a271f8be
commit afeb0acbe7
7 changed files with 109 additions and 50 deletions

View File

@@ -96,13 +96,12 @@ async def get_chat(
current_user: User = Depends(get_current_user),
) -> ChatDetailRead:
chat, members = await get_chat_for_user(db, chat_id=chat_id, user_id=current_user.id)
return ChatDetailRead(
id=chat.id,
type=chat.type,
title=chat.title,
pinned_message_id=chat.pinned_message_id,
created_at=chat.created_at,
members=members,
base = await serialize_chat_for_user(db, user_id=current_user.id, chat=chat)
return ChatDetailRead.model_validate(
{
**base.model_dump(),
"members": members,
}
)