Philipp Hörist pushed to branch master at gajim / gajim


Commits:
8d31febf by Philipp Hörist at 2025-01-23T20:32:35+01:00
refactor: Hide Voice/Video menu items

- - - - -
53e4b980 by Philipp Hörist at 2025-01-23T21:01:21+01:00
imprv: Chat: Add remove contact menu entry

- - - - -
4f8fa3a4 by Philipp Hörist at 2025-01-23T21:07:34+01:00
imprv: Don’t close chat on remove contact action

- - - - -


2 changed files:

- gajim/gtk/main.py
- gajim/gtk/menus.py


Changes:

=====================================
gajim/gtk/main.py
=====================================
@@ -1273,7 +1273,6 @@ def remove_contact(self, account: str, jid: JID) -> None:
         client = app.get_client(account)
 
         def _remove_contact():
-            self._chat_page.remove_chat(account, jid)
             client.get_module("Roster").delete_item(jid)
 
         contact = client.get_module("Contacts").get_contact(jid)


=====================================
gajim/gtk/menus.py
=====================================
@@ -107,17 +107,22 @@ def get_singlechat_menu(contact: types.BareContact) -> 
GajimMenu:
     params = AccountJidParam(account=account, jid=contact.jid)
 
     menu = GajimMenu()
-    menu.add_item(_("Block Contact…"), f"app.{account}-block-contact", params)
 
     submenu = get_send_file_submenu()
     menu.append_submenu(_("Send File"), submenu)
+    menu.add_item(_("Block Contact…"), f"app.{account}-block-contact", params)
 
-    menu.add_item(_("Start Voice Call…"), "win.start-voice-call")
-    menu.add_item(_("Start Video Call…"), "win.start-video-call")
+    # Disable because not maintained
+    # menu.add_item(_("Start Voice Call…"), "win.start-voice-call")
+    # menu.add_item(_("Start Video Call…"), "win.start-video-call")
 
     if can_add_to_roster(contact):
         params = AccountJidParam(account=account, jid=contact.jid)
-        menu.add_item(_("Add to Contact List…"), "win.add-to-roster", params)
+        menu.add_item(_("Add Contact…"), "win.add-to-roster", params)
+
+    if contact.is_in_roster:
+        params = GLib.Variant("as", [account, str(contact.jid)])
+        menu.add_item(_("Remove Contact…"), f"app.{account}-remove-contact", 
params)
 
     jids = [str(c.jid) for c in contact.get_resources()]
     if not jids:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/2aefca55d218b3efee84c9e573c450e1abc7f1ea...4f8fa3a44c669aee4dcd293f9cdca8af567e5c85

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/2aefca55d218b3efee84c9e573c450e1abc7f1ea...4f8fa3a44c669aee4dcd293f9cdca8af567e5c85
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to