project-robius / robrix

Robrix: a multi-platform Matrix chat client written in Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
107 stars 18 forks source link

Don't show message text input bar if the user cannot send messages in a room #231

Open kevinaboos opened 2 weeks ago

kevinaboos commented 2 weeks ago

Current behavior

Currently, Robrix unconditionally shows the message input bar at the bottom of the RoomScreen. This ignores the fact that the current logged-in user may not have sufficient permissions (power levels) to actually successfully send a message to that room.

Desired behavior

Instead, Robrix should show a different view component there (in place of the message input bar) when the user is viewing a room that they do not have permissions to send a message in.

Implementation ideas

We can use the Room:can_user_send_message() to determine whether the user is allowed to send a message in the current room. If that returns false, we should hide that message input bar and instead display a notice informing the user that they are not allowed to send messages to this room.

This should be checked (at a minimum) every time the user opens the room. An even better implementation would be to: