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:
upon the user opening the room, we subscribe to room state changes such that we can be notified if the user's permissions changes such that they can or cannot send a message to the room.
upon the user closing the room, unsubscribe from said state changes.
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 returnsfalse
, 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: