Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
da0eeb34 by wurstsalat at 2022-03-13T21:04:36+01:00
Groupchat: Disable quoting messages for visitors

Fixes #10796

- - - - -


1 changed file:

- gajim/gtk/conversation/rows/widgets.py


Changes:

=====================================
gajim/gtk/conversation/rows/widgets.py
=====================================
@@ -86,12 +86,20 @@ def _create_popover(self, show_retract: bool) -> None:
         menu_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
         menu_box.get_style_context().add_class('padding-6')
 
+        quote_enabled = True
+        if isinstance(self._contact, GroupchatContact):
+            if self._contact.is_joined:
+                self_contact = self._contact.get_self()
+                assert self_contact is not None
+                quote_enabled = not self_contact.role.is_visitor
+
         quote_button = Gtk.ModelButton()
         quote_button.set_halign(Gtk.Align.START)
         quote_button.connect('clicked', self._row.on_quote_message)
         quote_button.set_label(_('Quote…'))
         quote_button.set_image(Gtk.Image.new_from_icon_name(
             'mail-reply-sender-symbolic', Gtk.IconSize.MENU))
+        quote_button.set_sensitive(quote_enabled)
         menu_box.add(quote_button)
 
         copy_button = Gtk.ModelButton()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/da0eeb343e6440c083687dd5b8a5f11dccc62d66

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/da0eeb343e6440c083687dd5b8a5f11dccc62d66
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to