[fractal/editable-by-default] Make entry editable by default when no power_levels



commit 81b3f52219a2269dbd70cea348caef11c341b5fe
Author: Daniel GarcĂ­a Moreno <dani danigm net>
Date:   Sat Sep 28 10:31:46 2019 +0200

    Make entry editable by default when no power_levels
    
    For new rooms we're not receiving power_levels event, so we need to
    assume that the user can write.
    
    This is a quick fix to allow edit new rooms, but it could be better to
    request power_levels to the backend when we've no this information so we
    can disable the text entry if the user has no permissions to do that,
    but without the information we should assume that the user is able to
    write because it's the usual case.
    
    Fix https://gitlab.gnome.org/GNOME/fractal/issues/539

 fractal-gtk/src/appop/room.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/fractal-gtk/src/appop/room.rs b/fractal-gtk/src/appop/room.rs
index 2a408ecd..46fe86a1 100644
--- a/fractal-gtk/src/appop/room.rs
+++ b/fractal-gtk/src/appop/room.rs
@@ -156,7 +156,8 @@ impl AppOp {
                     .unwrap_or(-1),
             };
 
-            if user_power >= 0 {
+            // No room admin information, assuming normal
+            if user_power >= 0 || room.admins.len() == 0 {
                 msg_entry.set_editable(true);
                 msg_entry_stack.set_visible_child_name("Text Entry");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]