gajim.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
October
September
August
July
June
May
April
March
February
January
2025
December
November
October
September
August
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
List overview
Download
Commits
September 2021
----- 2026 -----
October 2026
September 2026
August 2026
July 2026
June 2026
May 2026
April 2026
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
commits@gajim.org
1 participants
49 discussions
Start a n
N
ew thread
[Git][gajim/gajim][mainwindow] StartChat: Improve no disco info handling
by Daniel Brötzmann (@wurstsalat)
14 Sep '21
14 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: f2abb4b9 by wurstsalat at 2021-09-14T19:01:11+02:00 StartChat: Improve no disco info handling - - - - - 2 changed files: - gajim/data/gui/start_chat_dialog.ui - gajim/gtk/start_chat.py Changes: ===================================== gajim/data/gui/start_chat_dialog.ui ===================================== @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.38.2 --> <interface> - <requires lib="gtk+" version="3.22"/> + <requires lib="gtk+" version="3.24"/> <object class="GtkListStore" id="account_store"> <columns> <!-- column-name icon --> @@ -546,6 +546,110 @@ <property name="position">4</property> </packing> </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="valign">center</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Start New Chat</property> + <style> + <class name="large-header"/> + <class name="margin-12"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Gajim was not able to gather infos about this address.</property> + <property name="justify">center</property> + <property name="wrap">True</property> + <property name="max-width-chars">40</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">avatar-default-symbolic</property> + <property name="icon_size">6</property> + <style> + <class name="dim-label"/> + <class name="margin-12"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-bottom">6</property> + <property name="label" translatable="yes">You can start a direct message chat, if you are sure this address is correct.</property> + <property name="justify">center</property> + <property name="wrap">True</property> + <property name="max-width-chars">40</property> + <style> + <class name="margin-12"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton"> + <property name="label" translatable="yes">Start New Chat</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="halign">center</property> + <signal name="clicked" handler="_on_no_disco_continue" swapped="no"/> + <style> + <class name="suggested-action"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <style> + <class name="margin-18"/> + </style> + </object> + <packing> + <property name="name">no-disco</property> + <property name="position">5</property> + </packing> + </child> </object> <object class="GtkBox" id="placeholder"> <property name="visible">True</property> ===================================== gajim/gtk/start_chat.py ===================================== @@ -22,6 +22,7 @@ from nbxmpp.errors import is_error from nbxmpp.errors import StanzaError +from nbxmpp.errors import TimeoutStanzaError from nbxmpp.errors import CancelledError from gajim.common import app @@ -64,7 +65,6 @@ def __init__(self): self._search_stopped = False self._redirected = False self._source_id = None - self._skip_disco = False self._ui = get_builder('start_chat_dialog.ui') self.add(self._ui.stack) @@ -72,6 +72,9 @@ def __init__(self): self._nick_chooser = NickChooser() self._ui.join_box.pack_start(self._nick_chooser, True, False, 0) + # Helper for the case where we don't receive a disco info + self._new_chat_row = None + self.new_contact_row_visible = False self.new_contact_rows = {} self._accounts = app.get_enabled_accounts_with_labels() @@ -306,7 +309,6 @@ def _start_new_chat(self, row): return self._disco_info(row) - GLib.timeout_add_seconds(10, self._continue_without_disco, row) return if row.groupchat: @@ -332,22 +334,20 @@ def _start_new_chat(self, row): def _disco_info(self, row): if not app.account_is_available(row.account): - # Account is disconnected: start a 1:1 chat - self._continue_without_disco(row) - return + # Account is disconnected: offer to open 1:1 chat anyway + self._new_chat_row = row + self._ui.stack.set_visible_child_name('no-disco') + return - # Reset self._skip_disco and start a disco info - self._skip_disco = False self._ui.stack.set_visible_child_name('progress') client = app.get_client(row.account) client.get_module('Discovery').disco_info( - row.jid, callback=self._disco_info_received, user_data=row) + row.jid, + callback=self._disco_info_received, + user_data=row, + timeout=10) def _disco_info_received(self, task): - if self._skip_disco: - # Stop here if disco time limit has been exceeded - return - row = task.get_user_data() try: result = task.finish() @@ -357,12 +357,21 @@ def _disco_info_received(self, task): 'subscription-required' # ejabberd ] if error.condition in contact_conditions: + # These error conditions are the result of + # querying contacts without subscription row.update_chat_type() self._start_new_chat(row) return + # Handle other possible errors self._show_error_page(error.get_text()) return + except TimeoutStanzaError: + # We reached the 10s timeout, but we should + # offer to open a chat anyway + self._new_chat_row = row + self._ui.stack.set_visible_child_name('no-disco') + return if result.is_muc: row.update_chat_type(groupchat=True) @@ -370,17 +379,9 @@ def _disco_info_received(self, task): row.update_chat_type() self._start_new_chat(row) - def _continue_without_disco(self, row): - current_page = self._ui.stack.get_visible_child_name() - if current_page not in ('progress', 'search'): - # Stop here if disco info already succeeded - return - - # Disco time limit has been exceeded, chat type is unknown: - # start a 1:1 chat - self._skip_disco = True - row.update_chat_type() - self._start_new_chat(row) + def _on_no_disco_continue(self, _button): + self._new_chat_row.update_chat_type() + self._start_new_chat(self._new_chat_row) def _disco_muc(self, account, jid, request_vcard): self._ui.stack.set_visible_child_name('progress') View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/f2abb4b915e2991f30530ffe4318ab67…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/f2abb4b915e2991f30530ffe4318ab67…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] Interface: (Re)Introduce start_chat_from_jid
by Daniel Brötzmann (@wurstsalat)
13 Sep '21
13 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 9ebc1826 by wurstsalat at 2021-09-13T23:42:05+02:00 Interface: (Re)Introduce start_chat_from_jid - - - - - 5 changed files: - gajim/app_actions.py - gajim/application.py - gajim/common/helpers.py - gajim/gui_interface.py - gajim/remote_control.py Changes: ===================================== gajim/app_actions.py ===================================== @@ -283,7 +283,7 @@ def copy_text(_action, param): def start_chat(_action, param): account, jid = param.get_strv() - app.interface.new_chat_from_jid(account, jid) + app.interface.start_chat_from_jid(account, jid) def on_groupchat_join(_action, param): ===================================== gajim/application.py ===================================== @@ -293,10 +293,7 @@ def _open_uris(self, uris): except Exception: app.log('uri_handler').error('Invalid URI: %s', cmd) - if len(accounts) == 1: - app.interface.new_chat_from_jid(accounts[0], jid, message) - else: - self.activate_action('start-chat', GLib.Variant('s', jid)) + app.interface.start_chat_from_jid(accounts[0], jid, message) def do_shutdown(self, *args): Gtk.Application.do_shutdown(self) ===================================== gajim/common/helpers.py ===================================== @@ -1017,7 +1017,7 @@ def open_uri(uri, account=None): Gio.AppInfo.launch_default_for_uri(uri.data) elif uri.type == URIType.AT: - app.interface.new_chat_from_jid(account, uri.data) + app.interface.start_chat_from_jid(account, uri.data) elif uri.type == URIType.XMPP: if account is None: @@ -1029,8 +1029,8 @@ def open_uri(uri, account=None): 'groupchat-join', GLib.Variant('as', [account, uri.data['jid']])) elif uri.action == URIAction.MESSAGE: - app.interface.new_chat_from_jid(account, uri.data['jid'], - message=uri.data.get('body')) + app.interface.start_chat_from_jid(account, uri.data['jid'], + message=uri.data.get('body')) else: log.warning('Cant open URI: %s', uri) ===================================== gajim/gui_interface.py ===================================== @@ -1088,6 +1088,16 @@ def show_add_join_groupchat(self, account, jid, nickname=None, app.window.add_group_chat(account, str(jid), select=True) + def start_chat_from_jid(self, account, jid, message=None): + if app.window.chat_exists(account, jid): + app.window.select_chat(account, jid) + control = app.window.get_control(account, jid) + control.msg_textview.insert_text(message) + return + + # TODO: handle message arg in StartChat + app.app.activate_action('start-chat', GLib.Variant('s', jid)) + @staticmethod def _on_muc_added(event): if app.window.chat_exists(event.account, event.jid): ===================================== gajim/remote_control.py ===================================== @@ -596,12 +596,10 @@ def open_chat(self, jid, account, message): connected_account = first_connected_acct if connected_account: - app.interface.new_chat_from_jid(connected_account, jid, message) + app.interface.start_chat_from_jid(connected_account, jid, message) # preserve the 'steal focus preservation' - win = app.interface.msg_win_mgr.get_window( - jid, connected_account).window - if win.get_property('visible'): - win.window.present() + if app.window.get_property('visible'): + app.window.present() return True return False View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9ebc18265fceafe948cb9dccb33ef397…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9ebc18265fceafe948cb9dccb33ef397…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 2 commits: StartChat: Add disco timeout and handle disconnected account
by Daniel Brötzmann (@wurstsalat)
13 Sep '21
13 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: dd3f3735 by wurstsalat at 2021-09-13T23:09:26+02:00 StartChat: Add disco timeout and handle disconnected account - - - - - f38ad47c by wurstsalat at 2021-09-13T23:14:03+02:00 StartChat: Rename new row to 'Start New Chat' - - - - - 1 changed file: - gajim/gtk/start_chat.py Changes: ===================================== gajim/gtk/start_chat.py ===================================== @@ -64,6 +64,7 @@ def __init__(self): self._search_stopped = False self._redirected = False self._source_id = None + self._skip_disco = False self._ui = get_builder('start_chat_dialog.ui') self.add(self._ui.stack) @@ -305,6 +306,7 @@ def _start_new_chat(self, row): return self._disco_info(row) + GLib.timeout_add_seconds(10, self._continue_without_disco, row) return if row.groupchat: @@ -329,12 +331,23 @@ def _start_new_chat(self, row): self.destroy() def _disco_info(self, row): + if not app.account_is_available(row.account): + # Account is disconnected: start a 1:1 chat + self._continue_without_disco(row) + return + + # Reset self._skip_disco and start a disco info + self._skip_disco = False self._ui.stack.set_visible_child_name('progress') client = app.get_client(row.account) client.get_module('Discovery').disco_info( row.jid, callback=self._disco_info_received, user_data=row) def _disco_info_received(self, task): + if self._skip_disco: + # Stop here if disco time limit has been exceeded + return + row = task.get_user_data() try: result = task.finish() @@ -357,6 +370,18 @@ def _disco_info_received(self, task): row.update_chat_type() self._start_new_chat(row) + def _continue_without_disco(self, row): + current_page = self._ui.stack.get_visible_child_name() + if current_page not in ('progress', 'search'): + # Stop here if disco info already succeeded + return + + # Disco time limit has been exceeded, chat type is unknown: + # start a 1:1 chat + self._skip_disco = True + row.update_chat_type() + self._start_new_chat(row) + def _disco_muc(self, account, jid, request_vcard): self._ui.stack.set_visible_child_name('progress') client = app.get_client(account) @@ -692,10 +717,7 @@ def __init__(self, account, contact, jid, name, show_account, box.set_hexpand(True) if self.name is None: - if self.groupchat: - self.name = _('Join Group Chat') - else: - self.name = _('Start Chat') + self.name = _('Start New Chat') self.name_label = Gtk.Label(label=self.name) self.name_label.set_ellipsize(Pango.EllipsizeMode.END) View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/a84557cd43f9fec52ad60d1b6c46ac9…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/a84557cd43f9fec52ad60d1b6c46ac9…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 2 commits: StartChat: Discover new chat type automatically
by Daniel Brötzmann (@wurstsalat)
13 Sep '21
13 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: e7dea036 by wurstsalat at 2021-09-13T18:13:53+02:00 StartChat: Discover new chat type automatically - - - - - a84557cd by wurstsalat at 2021-09-13T18:14:53+02:00 Remove obsolete roster_window.ui - - - - - 2 changed files: - − gajim/data/gui/roster_window.ui - gajim/gtk/start_chat.py Changes: ===================================== gajim/data/gui/roster_window.ui deleted ===================================== @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> -<interface> - <requires lib="gtk+" version="3.22"/> - <object class="GtkAccelGroup" id="accelgroup1"/> - <object class="GtkApplicationWindow" id="roster_window"> - <property name="name">RosterWindow</property> - <property name="width_request">85</property> - <property name="height_request">200</property> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Gajim</property> - <property name="role">roster</property> - <property name="default_width">250</property> - <property name="default_height">400</property> - <accel-groups> - <group name="accelgroup1"/> - </accel-groups> - <signal name="delete-event" handler="on_roster_window_delete_event" swapped="no"/> - <signal name="focus-in-event" handler="on_roster_window_focus_in_event" swapped="no"/> - <signal name="focus-out-event" handler="on_roster_window_focus_out_event" swapped="no"/> - <signal name="key-press-event" handler="on_roster_window_key_press_event" swapped="no"/> - <signal name="popup-menu" handler="on_roster_window_popup_menu" swapped="no"/> - <child> - <object class="GtkBox" id="roster_vbox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <child> - <placeholder/> - </child> - <child> - <object class="GtkPaned" id="roster_hpaned"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <signal name="notify" handler="on_roster_hpaned_notify" swapped="no"/> - <child> - <object class="GtkBox" id="roster_vbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkSearchEntry" id="rfilter_entry"> - <property name="can_focus">True</property> - <property name="no_show_all">True</property> - <property name="editable">False</property> - <signal name="icon-press" handler="on_rfilter_entry_icon_press" swapped="no"/> - <signal name="search-changed" handler="on_rfilter_entry_changed" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">never</property> - <child> - <object class="GtkTreeView" id="roster_treeview"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_tooltip">True</property> - <property name="headers_visible">False</property> - <property name="reorderable">True</property> - <signal name="button-press-event" handler="on_roster_treeview_button_press_event" swapped="no"/> - <signal name="key-press-event" handler="on_roster_treeview_key_press_event" swapped="no"/> - <signal name="row-activated" handler="on_roster_treeview_row_activated" swapped="no"/> - <signal name="row-collapsed" handler="on_roster_treeview_row_collapsed" swapped="no"/> - <signal name="row-expanded" handler="on_roster_treeview_row_expanded" swapped="no"/> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> - </child> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="resize">False</property> - <property name="shrink">True</property> - </packing> - </child> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - <child type="titlebar"> - <placeholder/> - </child> - </object> -</interface> ===================================== gajim/gtk/start_chat.py ===================================== @@ -73,7 +73,6 @@ def __init__(self): self.new_contact_row_visible = False self.new_contact_rows = {} - self.new_groupchat_rows = {} self._accounts = app.get_enabled_accounts_with_labels() rows = [] @@ -153,7 +152,6 @@ def _add_contacts(self, rows): def _add_groupchats(self, rows): show_account = len(self._accounts) > 1 for account, _label in self._accounts: - self.new_groupchat_rows[account] = None client = app.get_client(account) bookmarks = client.get_module('Bookmarks').bookmarks for bookmark in bookmarks: @@ -306,6 +304,9 @@ def _start_new_chat(self, row): self._show_error_page(error) return + self._disco_info(row) + return + if row.groupchat: if not app.account_is_available(row.account): self._show_error_page(_('You can not join a group chat ' @@ -327,17 +328,46 @@ def _start_new_chat(self, row): self.ready_to_destroy = True self.destroy() + def _disco_info(self, row): + self._ui.stack.set_visible_child_name('progress') + client = app.get_client(row.account) + client.get_module('Discovery').disco_info( + row.jid, callback=self._disco_info_received, user_data=row) + + def _disco_info_received(self, task): + row = task.get_user_data() + try: + result = task.finish() + except StanzaError as error: + contact_conditions = [ + 'service-unavailable', # Prosody + 'subscription-required' # ejabberd + ] + if error.condition in contact_conditions: + row.update_chat_type() + self._start_new_chat(row) + return + + self._show_error_page(error.get_text()) + return + + if result.is_muc: + row.update_chat_type(groupchat=True) + else: + row.update_chat_type() + self._start_new_chat(row) + def _disco_muc(self, account, jid, request_vcard): self._ui.stack.set_visible_child_name('progress') - con = app.connections[account] - con.get_module('Discovery').disco_muc( + client = app.get_client(account) + client.get_module('Discovery').disco_muc( jid, request_vcard=request_vcard, allow_redirect=True, - callback=self._disco_info_received, + callback=self._muc_disco_info_received, user_data=account) - def _disco_info_received(self, task): + def _muc_disco_info_received(self, task): try: result = task.finish() except StanzaError as error: @@ -457,11 +487,7 @@ def _add_new_jid_row(self): show_account = len(self._accounts) > 1 row = ContactRow(account, None, '', None, show_account) self.new_contact_rows[account] = row - group_row = ContactRow(account, None, '', None, show_account, - groupchat=True) - self.new_groupchat_rows[account] = group_row self._ui.listbox.add(row) - self._ui.listbox.add(group_row) row.get_parent().show_all() self.new_contact_row_visible = True @@ -471,14 +497,11 @@ def _remove_new_jid_row(self): for account in self.new_contact_rows: self._ui.listbox.remove( self.new_contact_rows[account]) - self._ui.listbox.remove( - self.new_groupchat_rows[account]) self.new_contact_row_visible = False def _update_new_jid_rows(self, search_text): for account in self.new_contact_rows: self.new_contact_rows[account].update_jid(search_text) - self.new_groupchat_rows[account].update_jid(search_text) def _select_new_match(self, _entry, direction): selected_row = self._ui.listbox.get_selected_row() @@ -719,6 +742,10 @@ def update_jid(self, jid): self.jid = jid self.jid_label.set_text(jid) + def update_chat_type(self, groupchat=False): + self.new = False + self.groupchat = groupchat + def get_search_text(self): if self.contact is None and not self.groupchat: return str(self.jid) View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1d0a02342555529406eb75f4d0be942…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1d0a02342555529406eb75f4d0be942…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 4 commits: App menu: Remove 'Show Roster' and 'Show Transports'
by Daniel Brötzmann (@wurstsalat)
12 Sep '21
12 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 41df40f5 by wurstsalat at 2021-09-12T18:01:04+02:00 App menu: Remove 'Show Roster' and 'Show Transports' - - - - - 5a64bc8f by wurstsalat at 2021-09-12T18:37:22+02:00 Accounts: Add option for publishing current Media Playback - - - - - 8ae64852 by wurstsalat at 2021-09-12T18:38:57+02:00 Interface: Disable publishing location permanently - - - - - 1d0a0234 by wurstsalat at 2021-09-12T18:39:17+02:00 Remove obsolete account_context_menu.ui - - - - - 5 changed files: - gajim/application.py - − gajim/data/gui/account_context_menu.ui - gajim/data/gui/application_menu.ui - gajim/gtk/accounts.py - gajim/gui_interface.py Changes: ===================================== gajim/application.py ===================================== @@ -509,7 +509,6 @@ def _set_shortcuts(self): 'app.ipython': ['<Primary><Alt>I'], 'app.start-chat::': ['<Primary>N'], 'app.create-groupchat::': ['<Primary>G'], - 'win.show-roster': ['<Primary>R'], 'win.show-offline': ['<Primary>O'], 'win.show-active': ['<Primary>Y'], 'win.change-nickname': ['<Primary><Shift>N'], ===================================== gajim/data/gui/account_context_menu.ui deleted ===================================== @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> -<interface> - <requires lib="gtk+" version="3.12"/> - <object class="GtkMenu" id="account_context_menu"> - <property name="can_focus">False</property> - <child> - <object class="GtkMenuItem" id="status_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Status</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="pep_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label" translatable="yes">_Personal Events</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="separator"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="add_contact_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Add Contact...</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="service_discovery_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Discover Services</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="execute_command_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Execute Command...</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="view_server_info_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_View Server Info</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="separator1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="edit_account_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Modify Account…</property> - <property name="use_underline">True</property> - </object> - </child> - </object> -</interface> ===================================== gajim/data/gui/application_menu.ui ===================================== @@ -38,10 +38,6 @@ <submenu> <attribute name="label" translatable="yes">_View</attribute> <section> - <item> - <attribute name="label" translatable="yes">Show _Contact List</attribute> - <attribute name="action">win.show-roster</attribute> - </item> <item> <attribute name="label" translatable="yes">Show _Offline Contacts</attribute> <attribute name="action">win.show-offline</attribute> @@ -50,10 +46,6 @@ <attribute name="label" translatable="yes">Show _Active Contacts</attribute> <attribute name="action">win.show-active</attribute> </item> - <item> - <attribute name="label" translatable="yes">Show _Transports</attribute> - <attribute name="action">win.show-transports</attribute> - </item> </section> <section> <item> ===================================== gajim/gtk/accounts.py ===================================== @@ -723,6 +723,11 @@ def __init__(self, account): desc=_('Disclose information about the client ' 'and operating system you currently use')), + Setting(SettingKind.SWITCH, _('Media Playback'), + SettingType.ACCOUNT_CONFIG, 'publish_tune', + desc=_('Disclose information about media that is ' + 'currently being played on your system.')), + Setting(SettingKind.SWITCH, _('Ignore Unknown Contacts'), SettingType.ACCOUNT_CONFIG, 'ignore_unknown_contacts', desc=_('Ignore everything from contacts not in your ' ===================================== gajim/gui_interface.py ===================================== @@ -521,7 +521,8 @@ def handle_event_signed_in(event): # enable location listener if (pep_supported and app.is_installed('GEOCLUE') and app.settings.get_account_setting(account, 'publish_location')): - location.enable() + pass + # location.enable() if ask_for_status_message(event.conn.status, signin=True): app.window.show_account_page(account) View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/e7df467a1174d465b595182f1392693…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/e7df467a1174d465b595182f1392693…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 4 commits: Helpers: Fix ignore_contact
by Daniel Brötzmann (@wurstsalat)
12 Sep '21
12 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 64b4f0c1 by wurstsalat at 2021-09-12T17:34:45+02:00 Helpers: Fix ignore_contact - - - - - 48d26cfd by wurstsalat at 2021-09-12T17:35:28+02:00 ServiceDiscoveryWindow: Fix detecting gateway - - - - - 2e58361c by wurstsalat at 2021-09-12T17:38:56+02:00 ZeroconfVcardWindow: Move to gtk folder - - - - - e7df467a by wurstsalat at 2021-09-12T17:47:30+02:00 Remove Zeroconf context menu All options this menu offers would fit on an account page - - - - - 4 changed files: - gajim/common/helpers.py - − gajim/data/gui/zeroconf_context_menu.ui - gajim/gtk/discovery.py - gajim/vcard.py → gajim/gtk/zeroconf_vcard.py Changes: ===================================== gajim/common/helpers.py ===================================== @@ -802,16 +802,19 @@ def load_json(path, key=None, default=None): return json_dict return json_dict.get(key, default) + def ignore_contact(account, jid): - jid = str(jid) - known_contact = app.contacts.get_contacts(account, jid) - ignore = app.settings.get_account_setting(account, - 'ignore_unknown_contacts') - if ignore and not known_contact: - log.info('Ignore unknown contact %s', jid) + client = app.get_client(account) + contact = client.get_module('Contact').get_contact(jid) + + ignore_unknown = app.settings.get_account_setting( + account, 'ignore_unknown_contacts') + if ignore_unknown and not contact.is_in_roster: + log.info('Ignore unknown contact %s', str(jid)) return True return False + class AdditionalDataDict(collections.UserDict): def __init__(self, initialdata=None): collections.UserDict.__init__(self, initialdata) ===================================== gajim/data/gui/zeroconf_context_menu.ui deleted ===================================== @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> -<interface> - <requires lib="gtk+" version="3.12"/> - <object class="GtkMenu" id="zeroconf_context_menu"> - <property name="can_focus">False</property> - <child> - <object class="GtkMenuItem" id="status_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Status</property> - <property name="use_underline">True</property> - </object> - </child> - <child> - <object class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - <child> - <object class="GtkMenuItem" id="zeroconf_properties_menuitem"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Modify Account…</property> - <property name="use_underline">True</property> - </object> - </child> - </object> -</interface> ===================================== gajim/gtk/discovery.py ===================================== @@ -1413,12 +1413,10 @@ def _update_actions(self, jid, node, identities, features, data): jid != self.jid): # We can register this agent registered_transports = [] - jid_list = app.contacts.get_jid_list(self.account) - for jid_ in jid_list: - contact = app.contacts.get_first_contact_from_jid( - self.account, jid_) - if _('Transports') in contact.groups: - registered_transports.append(jid_) + client = app.get_client(self.account) + for contact in client.get_module('Roster').iter_contacts(): + if contact.is_gateway: + registered_transports.append(contact.jid) registered_transports.append(self.jid) if jid in registered_transports: self.register_button.set_label(_('_Edit')) ===================================== gajim/vcard.py → gajim/gtk/zeroconf_vcard.py ===================================== @@ -1,16 +1,3 @@ -# Copyright (C) 2003-2014 Yann Leboulanger <asterix AT
lagaule.org
> -# Copyright (C) 2005 Vincent Hanquez <tab AT
snarc.org
> -# Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT
gmail.com
> -# Copyright (C) 2006 Junglecow J <junglecow AT
gmail.com
> -# Dimitur Kirov <dkirov AT
gmail.com
> -# Travis Shirk <travis AT
pobox.com
> -# Stefan Bethge <stefan AT lanpartei.de> -# Copyright (C) 2006-2008 Jean-Marie Traissard <jim AT
lapin.org
> -# Copyright (C) 2007 Lukas Petrovicky <lukas AT
petrovicky.net
> -# Copyright (C) 2008 Brendan Taylor <whateley AT
gmail.com
> -# Jonathan Schleifer <js-gajim AT
webkeks.org
> -# Stephan Erb <steve-e AT h3c.de> -# # This file is part of Gajim. # # Gajim is free software; you can redistribute it and/or modify View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/17950bf7e189744120b2bc1d8d78755…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/17950bf7e189744120b2bc1d8d78755…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 5 commits: Helpers: Remove obsolete get_icon_name_to_show
by Daniel Brötzmann (@wurstsalat)
11 Sep '21
11 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: e4a7b414 by wurstsalat at 2021-09-11T23:34:27+02:00 Helpers: Remove obsolete get_icon_name_to_show - - - - - 6e6e69f8 by wurstsalat at 2021-09-11T23:46:40+02:00 Remove remnants of minimizable controls - - - - - fc116545 by wurstsalat at 2021-09-12T00:09:52+02:00 Chat Controls: Remove contact drag and drop for now - - - - - b69ebe31 by wurstsalat at 2021-09-12T00:25:07+02:00 Interface: Remove roster remnants - - - - - 17950bf7 by wurstsalat at 2021-09-12T00:36:09+02:00 Helpers: Remove obsolete methods - - - - - 10 changed files: - gajim/application.py - gajim/common/config.py - gajim/common/helpers.py - gajim/common/modules/adhoc_commands.py - gajim/common/setting_values.py - gajim/gtk/const.py - gajim/gtk/controls/base.py - gajim/gtk/controls/chat.py - gajim/gtk/controls/groupchat.py - gajim/remote_control.py Changes: ===================================== gajim/application.py ===================================== @@ -300,9 +300,6 @@ def _open_uris(self, uris): def do_shutdown(self, *args): Gtk.Application.do_shutdown(self) - # Shutdown GUI and save config - if hasattr(self.interface, 'roster') and self.interface.roster: - self.interface.roster.prepare_quit() # Commit any outstanding SQL transactions app.storage.cache.shutdown() ===================================== gajim/common/config.py ===================================== @@ -124,7 +124,7 @@ class Config: 'remote_control': [opt_bool, False, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True], 'confirm_paste_image': [opt_bool, True, _('Ask before pasting an image.')], 'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')], - 'confirm_close_multiple_tabs': [opt_bool, True, _('Ask before closing tabbed chat window if there are chats that can lose data (chat, private chat, group chat that will not be minimized).')], + 'confirm_close_multiple_tabs': [opt_bool, True, _('Ask before closing tabbed chat window if there are chats that can lose data (chat, private chat).')], 'notify_on_file_complete': [opt_bool, True], 'file_transfers_port': [opt_int, 28011], 'ft_add_hosts_to_send': [opt_str, '', _('List of send hosts (comma separated) in addition to local interfaces for file transfers (in case of address translation/port forwarding).')], ===================================== gajim/common/helpers.py ===================================== @@ -78,7 +78,6 @@ from gajim.common.i18n import ngettext from gajim.common.i18n import get_rfc5646_lang from gajim.common.const import ShowConstant -from gajim.common.const import Display from gajim.common.const import URIType from gajim.common.const import URIAction from gajim.common.const import GIO_TLS_ERRORS @@ -90,11 +89,6 @@ log = logging.getLogger('gajim.c.helpers') -special_groups = (_('Transports'), - _('Not in contact list'), - _('Observers'), - _('Group chats')) - URL_REGEX = re.compile( r"(www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'\"]+[^!,\.\s<>\)'\"\]]") @@ -438,10 +432,6 @@ def _cut_if_long(string_): reduced_text = '' return reduced_text -def get_account_status(account): - status = reduce_chars_newlines(account['status_line'], 100, 1) - return status - def get_contact_dict_for_account(account): """ @@ -598,30 +588,6 @@ def statuses_unified(): return False return True -def get_icon_name_to_show(contact, account=None): - """ - Get the icon name to show in online, away, requested, etc - """ - if account and account in app.interface.minimized_controls and \ - contact.jid in app.interface.minimized_controls[account] and app.interface.\ - minimized_controls[account][contact.jid].get_nb_unread_pm() > 0: - return 'event' - if account and contact.jid in app.gc_connected[account]: - if app.gc_connected[account][contact.jid]: - return 'muc-active' - return 'muc-inactive' - if contact.jid.find('@') <= 0: # if not '@' or '@' starts the jid ==> agent - return contact.show - if contact.sub in ('both', 'to'): - return contact.show - if contact.ask == 'subscribe': - return 'requested' - transport = app.get_transport_name_from_jid(contact.jid) - if transport: - return contact.show - if contact.show in SHOW_LIST: - return contact.show - return 'notinroster' def get_full_jid_from_iq(iq_obj): """ @@ -736,11 +702,6 @@ def allow_sound_notification(account, sound_event): return False -def get_current_show(account): - if account not in app.connections: - return 'offline' - return app.connections[account].status - def get_optional_features(account): features = [] ===================================== gajim/common/modules/adhoc_commands.py ===================================== @@ -175,8 +175,8 @@ def second_step(self, request): now=presencetype == 'offline') # send new status - app.interface.roster.send_status( - self.connection.name, presencetype, presencedesc) + app.get_client(self.connection.name).change_status( + presencetype, presencedesc) return False # finish the session ===================================== gajim/common/setting_values.py ===================================== @@ -370,7 +370,7 @@ class _ACCOUNT_DEFAULT: 'remote_control': _('If checked, Gajim can be controlled remotely using gajim-remote.'), 'confirm_paste_image': _('Ask before pasting an image.'), 'confirm_close_muc': _('Ask before closing a group chat tab/window.'), - 'confirm_close_multiple_tabs': _('Ask before closing tabbed chat window if there are chats that can lose data (chat, private chat, group chat that will not be minimized).'), + 'confirm_close_multiple_tabs': _('Ask before closing tabbed chat window if there are chats that can lose data (chat, private chat).'), 'file_transfers_port': '', 'ft_add_hosts_to_send': _('List of send hosts (comma separated) in addition to local interfaces for file transfers (in case of address translation/port forwarding).'), 'use_kib_mib': _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.'), ===================================== gajim/gtk/const.py ===================================== @@ -28,6 +28,9 @@ DEFAULT_WORKSPACE_COLOR = 'rgb(191,15,167)' +# Drag and drop target type URI list (for dropped files) +TARGET_TYPE_URI_LIST = 80 + @unique class Theme(IntEnum): ===================================== gajim/gtk/controls/base.py ===================================== @@ -61,6 +61,7 @@ from gajim.gui.util import get_show_in_systray from gajim.gui.util import AccountBadge from gajim.gui.const import ControlType # pylint: disable=unused-import +from gajim.gui.const import TARGET_TYPE_URI_LIST from gajim.gui.emoji_chooser import emoji_chooser from gajim.command_system.implementation.middleware import ChatCommandProcessor @@ -142,11 +143,10 @@ def __init__(self, widget_name, account, jid): self.xml.overlay.connect('drag-motion', self._on_drag_motion) self.xml.overlay.connect('drag-leave', self._on_drag_leave) - self.TARGET_TYPE_URI_LIST = 80 uri_entry = Gtk.TargetEntry.new( 'text/uri-list', Gtk.TargetFlags.OTHER_APP, - self.TARGET_TYPE_URI_LIST) + TARGET_TYPE_URI_LIST) dst_targets = Gtk.TargetList.new([uri_entry]) dst_targets.add_text_targets(0) self._dnd_list = [uri_entry, @@ -338,14 +338,6 @@ def is_privatechat(self): def is_groupchat(self): return self._type.is_groupchat - def minimizable(self): - """ - Called to check if control can be minimized - - Derived classes MAY implement this. - """ - return False - def safe_shutdown(self): """ Called to check if control can be closed without losing data. @@ -355,13 +347,11 @@ def safe_shutdown(self): """ return True - def allow_shutdown(self, method, on_response_yes, on_response_no, - on_response_minimize): + def allow_shutdown(self, method, on_response_yes, on_response_no): """ Called to check is a control is allowed to shutdown. If a control is not in a suitable shutdown state this method should call on_response_no, else on_response_yes or - on_response_minimize Derived classes MAY implement this. """ ===================================== gajim/gtk/controls/chat.py ===================================== @@ -54,6 +54,8 @@ from gajim.gui.adhoc_muc import AdhocMUC from gajim.gui.call_widget import CallWidget +from gajim.gui.const import TARGET_TYPE_URI_LIST +from gajim.gui.const import ControlType from gajim.gui.dialogs import DialogButton from gajim.gui.dialogs import ConfirmationDialog from gajim.gui.util import get_cursor @@ -63,7 +65,6 @@ from gajim.gui.util import format_location from gajim.gui.util import get_activity_icon_name from gajim.gui.util import open_window -from gajim.gui.const import ControlType from gajim.command_system.implementation.hosts import ChatCommands from gajim.command_system.framework import CommandHost # pylint: disable=unused-import @@ -657,7 +658,7 @@ def shutdown(self): super(ChatControl, self).shutdown() app.check_finalize(self) - def allow_shutdown(self, _method, on_yes, on_no, _on_minimize): + def allow_shutdown(self, _method, on_yes, on_no): time_ = app.last_message_time[self.account][self.contact.jid] # 2 seconds if time.time() - time_ < 2: @@ -699,30 +700,12 @@ def _on_drag_data_received(self, _widget, _context, _x_coord, _y_coord, if not selection.get_data(): return - if target_type == self.TARGET_TYPE_URI_LIST: + log.debug('Drop received: %s, %s', selection.get_data(), target_type) + + # TODO: Contact drag and drop for AdHocMUC + if target_type == TARGET_TYPE_URI_LIST: # File drag and drop (handled in chat_control_base) self.drag_data_file_transfer(selection) - else: - # Convert single chat to MUC - treeview = app.interface.roster.tree - model = treeview.get_model() - data = selection.get_data().decode() - tree_selection = treeview.get_selection() - if tree_selection.count_selected_rows() == 0: - return - path = tree_selection.get_selected_rows()[1][0] - iter_ = model.get_iter(path) - type_ = model[iter_][2] - if type_ != 'contact': # Source is not a contact - return - dropped_jid = data - - dropped_transport = app.get_transport_name_from_jid(dropped_jid) - c_transport = app.get_transport_name_from_jid(self.contact.jid) - if dropped_transport or c_transport: - return # transport contacts cannot be invited - - AdhocMUC(self.account, [self.contact.jid], [dropped_jid]) def _on_client_state_changed(self, _client, _signal_name, state): self.msg_textview.set_sensitive(state.is_connected) ===================================== gajim/gtk/controls/groupchat.py ===================================== @@ -56,6 +56,8 @@ from gajim.command_system.implementation.hosts import GroupChatCommands +from gajim.gui.const import ControlType +from gajim.gui.const import TARGET_TYPE_URI_LIST from gajim.gui.dialogs import DialogButton from gajim.gui.dialogs import ConfirmationCheckDialog from gajim.gui.dialogs import ConfirmationDialog @@ -71,7 +73,6 @@ from gajim.gui.util import NickCompletionGenerator from gajim.gui.util import get_app_window from gajim.gui.util import open_window -from gajim.gui.const import ControlType log = logging.getLogger('gajim.gui.controls.groupchat') @@ -93,7 +94,6 @@ def __init__(self, account, jid): self._client.connect_signal('state-changed', self._on_client_state_changed) - self.force_non_minimizable = False self.is_anonymous = True self.toggle_emoticons() @@ -1232,22 +1232,12 @@ def _on_drag_data_received(self, _widget, _context, _x_coord, _y_coord, if not selection.get_data(): return - if target_type == self.TARGET_TYPE_URI_LIST: + log.debug('Drop received: %s, %s', selection.get_data(), target_type) + + # TODO: Contact drag and drop for Invitations + if target_type == TARGET_TYPE_URI_LIST: # File drag and drop (handled in chat_control_base) self.drag_data_file_transfer(selection) - else: - # Invite contact to groupchat - treeview = app.interface.roster.tree - model = treeview.get_model() - data = selection.get_data().decode() - path = treeview.get_selection().get_selected_rows()[1][0] - iter_ = model.get_iter(path) - type_ = model[iter_][2] - if type_ != 'contact': # Source is not a contact - return - contact_jid = data - - self.invite(contact_jid) def _jid_not_blocked(self, bare_jid: str) -> bool: fjid = self.room_jid + '/' + bare_jid ===================================== gajim/remote_control.py ===================================== @@ -566,7 +566,6 @@ def open_chat(self, jid, account, message): # Jid is not conform, ignore it return False - minimized_control = None if account: accounts = [account] else: @@ -583,8 +582,6 @@ def open_chat(self, jid, account, message): break # jid is in roster if contact: - minimized_control = \ - jid in app.interface.minimized_controls[acct] connected_account = acct break # we send the message to jid not in roster, because account is @@ -598,10 +595,6 @@ def open_chat(self, jid, account, message): if connected_account is None and first_connected_acct: connected_account = first_connected_acct - if minimized_control: - app.interface.roster.on_groupchat_maximized( - None, jid, connected_account) - if connected_account: app.interface.new_chat_from_jid(connected_account, jid, message) # preserve the 'steal focus preservation' @@ -624,7 +617,7 @@ def change_status(self, status, message, account): if account not in app.connections: return False status = app.connections[account].status - GLib.idle_add(app.interface.roster.send_status, account, status, + GLib.idle_add(app.connections[account].change_status, status, message) else: # account not specified, so change the status of all accounts @@ -638,7 +631,7 @@ def change_status(self, status, message, account): if acc not in app.connections: continue status_ = app.connections[acc].status - GLib.idle_add(app.interface.roster.send_status, acc, status_, + GLib.idle_add(app.connections[acc].change_status, status_, message) return False View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/af774b00e4e20ab224193dedffe9439…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/af774b00e4e20ab224193dedffe9439…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 2 commits: ServiceRegistration: Use window const
by Daniel Brötzmann (@wurstsalat)
11 Sep '21
11 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 3e546785 by wurstsalat at 2021-09-11T21:15:24+02:00 ServiceRegistration: Use window const - - - - - af774b00 by wurstsalat at 2021-09-11T21:24:20+02:00 Settings: Remove use_transports_iconsets - - - - - 8 changed files: - gajim/common/app.py - gajim/common/setting_values.py - gajim/gtk/add_contact.py - gajim/gtk/const.py - gajim/gtk/discovery.py - gajim/gtk/preferences.py - gajim/gtk/roster.py - gajim/gtk/service_registration.py Changes: ===================================== gajim/common/app.py ===================================== @@ -473,10 +473,12 @@ def get_transport_name_from_jid(jid, use_config_setting=True): If JID is not from transport returns None. """ + # TODO: Rewrite/remove + #FIXME: jid can be None! one TB I saw had this problem: # in the code block # it is a groupchat presence in handle_event_notify # jid was None. Yann why? - if not jid or (use_config_setting and not config.get('use_transports_iconsets')): + if not jid: return host = get_server_from_jid(jid) ===================================== gajim/common/setting_values.py ===================================== @@ -33,7 +33,6 @@ class _ACCOUNT_DEFAULT: 'trayicon': 'always', 'allow_hide_roster': False, 'iconset': 'dcraven', - 'use_transports_iconsets': True, 'collapsed_rows': '', 'roster_theme': 'default', 'sort_by_show_in_roster': True, ===================================== gajim/gtk/add_contact.py ===================================== @@ -30,7 +30,6 @@ from .assistant import Page from .assistant import ErrorPage from .groupchat_info import GroupChatInfoScrolled -from .service_registration import ServiceRegistration from .util import get_builder from .util import open_window @@ -439,7 +438,10 @@ def prepare(self, account, result): _('This gateway does not support Ad-Hoc Commands.')) def _on_register_clicked(self, _button): - ServiceRegistration(self._account, self._result.jid) + open_window( + 'ServiceRegistration', + account=self._account, + address=self._result.jid) def _on_command_clicked(self, _button): AdHocCommand(self._account, self._result.jid) ===================================== gajim/gtk/const.py ===================================== @@ -135,4 +135,5 @@ def __str__(self): 'ContactInfo': 'gajim.gui.contact_info', 'WorkspaceDialog': 'gajim.gui.workspace_dialog', 'RosterItemExchange': 'gajim.gui.roster_item_exchange', + 'ServiceRegistration': 'gajim.gui.service_registration', } ===================================== gajim/gtk/discovery.py ===================================== @@ -61,9 +61,9 @@ from .adhoc import AdHocCommand from .dialogs import ErrorDialog from .search import Search -from .service_registration import ServiceRegistration from .util import icon_exists from .util import get_builder +from .util import open_window LABELS = { 1: _('This service has not yet responded with detailed information'), @@ -1345,7 +1345,8 @@ def _on_register_button_clicked(self, widget=None): return jid = model[iter_][0] if jid: - ServiceRegistration(self.account, jid) + open_window( + 'ServiceRegistration', account=self.account, address=jid) def _on_join_button_clicked(self, widget): """ ===================================== gajim/gtk/preferences.py ===================================== @@ -758,13 +758,6 @@ def __init__(self, *args): 'iconset', props={'entries': iconset_items}, callback=self._on_iconset_changed), - - Setting(SettingKind.SWITCH, - _('Use Transport Icons'), - SettingType.CONFIG, - 'use_transports_iconsets', - desc=_('Display protocol-specific status icons ' - '(ICQ, ..)')), ] PreferenceBox.__init__(self, settings) ===================================== gajim/gtk/roster.py ===================================== @@ -24,9 +24,9 @@ from .dialogs import ConfirmationDialog from .dialogs import DialogButton from .tooltips import RosterTooltip -from .service_registration import ServiceRegistration from .util import EventHelper from .util import get_builder +from .util import open_window log = logging.getLogger('gajim.gui.roster') @@ -268,7 +268,10 @@ def _on_contact_info(self, _action, param): app.window.contact_info(self._account, param.get_string()) def _on_modify_gateway(self, _action, param): - ServiceRegistration(self._account, param.get_string()) + open_window( + 'ServiceRegistration', + account=self._account, + address=param.get_string()) def _on_execute_command(self, _action, param): app.window.execute_command(self._account, param.get_string()) ===================================== gajim/gtk/service_registration.py ===================================== @@ -38,12 +38,12 @@ class Page(IntEnum): class ServiceRegistration(Gtk.Assistant): - def __init__(self, account, agent): + def __init__(self, account, address): Gtk.Assistant.__init__(self) + self.account = account self._con = app.connections[account] - self._agent = agent - self._account = account + self._agent = address self._data_form_widget = None self.set_application(app.app) View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1f5d3999c6ed4628dd8497ba4e5b154…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/1f5d3999c6ed4628dd8497ba4e5b154…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 3 commits: Interface: Replace 'show_or_join_groupchat'
by Daniel Brötzmann (@wurstsalat)
11 Sep '21
11 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 0375c447 by wurstsalat at 2021-09-11T18:38:22+02:00 Interface: Replace 'show_or_join_groupchat' - - - - - 5fe98de6 by wurstsalat at 2021-09-11T19:19:38+02:00 AddContact: Make jid public for window management - - - - - 1f5d3999 by wurstsalat at 2021-09-11T19:45:30+02:00 ChatList: Update unread count when removing row - - - - - 5 changed files: - gajim/gtk/add_contact.py - gajim/gtk/chat_list.py - gajim/gtk/discovery.py - gajim/gui_interface.py - gajim/remote_control.py Changes: ===================================== gajim/gtk/add_contact.py ===================================== @@ -41,7 +41,7 @@ class AddContact(Assistant): def __init__(self, account=None, jid=None, nick=None): Assistant.__init__(self) self.account = account - self._jid = jid + self.jid = jid self._nick = nick self._result = None ===================================== gajim/gtk/chat_list.py ===================================== @@ -248,6 +248,7 @@ def remove_chat(self, account, jid): row = self._chats.pop((account, jid)) self.remove(row) row.destroy() + self.emit_unread_changed() def remove_chats_for_account(self, account): for row_account, jid in list(self._chats.keys()): ===================================== gajim/gtk/discovery.py ===================================== @@ -1357,7 +1357,7 @@ def _on_join_button_clicked(self, widget): if not iter_: return service = model[iter_][0] - app.interface.show_or_join_groupchat(self.account, service) + app.interface.show_add_join_groupchat(self.account, service) def update_actions(self): if self.execute_button: @@ -1723,7 +1723,7 @@ def _on_join_button_clicked(self, *args): if not iter_: return service = model[iter_][0] - app.interface.show_or_join_groupchat(self.account, service) + app.interface.show_add_join_groupchat(self.account, service) def update_actions(self): sens = \ ===================================== gajim/gui_interface.py ===================================== @@ -1078,10 +1078,12 @@ def create_groupchat(self, account, room_jid, config): client = app.get_client(account) client.get_module('MUC').create(room_jid, config) - def show_add_join_groupchat(self, account, jid, nickname=None): + def show_add_join_groupchat(self, account, jid, nickname=None, + password=None): if not app.window.chat_exists(account, jid): client = app.get_client(account) - client.get_module('MUC').join(jid, nick=nickname) + client.get_module('MUC').join( + jid, nick=nickname, password=password) app.window.add_group_chat(account, str(jid), select=True) ===================================== gajim/remote_control.py ===================================== @@ -858,9 +858,9 @@ def join_room(self, room_jid, password, account): # zeroconf not support groupchats return - app.interface.show_or_join_groupchat(account, - room_jid, - password=password) + app.interface.show_add_join_groupchat(account, + room_jid, + password=password) def Introspect(self): return self.__doc__ View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/c8b638ddca8366ef2a93f6fd3f60021…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/c8b638ddca8366ef2a93f6fd3f60021…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
[Git][gajim/gajim][mainwindow] 4 commits: ContactInfo: Use 'Share Status' in label
by Daniel Brötzmann (@wurstsalat)
11 Sep '21
11 Sep '21
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim Commits: 302a30e0 by wurstsalat at 2021-09-11T17:10:17+02:00 ContactInfo: Use 'Share Status' in label - - - - - f3e1dd77 by wurstsalat at 2021-09-11T17:10:40+02:00 AddContact: App action improvements - - - - - 01608dea by wurstsalat at 2021-09-11T17:54:58+02:00 AddContact: Fix account handling - - - - - c8b638dd by wurstsalat at 2021-09-11T18:00:24+02:00 Roster: Improve gateway menu - - - - - 7 changed files: - gajim/app_actions.py - gajim/application.py - gajim/data/gui/add_contact.ui - gajim/data/gui/contact_info.ui - gajim/gtk/add_contact.py - gajim/gtk/roster.py - gajim/gui_menu_builder.py Changes: ===================================== gajim/app_actions.py ===================================== @@ -102,6 +102,7 @@ def on_service_disco(_action, param): except GajimGeneralException: pass + def on_create_gc(_action, param): account = param.get_string() open_window('CreateGroupchatWindow', account=account or None) @@ -109,7 +110,7 @@ def on_create_gc(_action, param): def on_add_contact(_action, param): account, jid = param.get_strv() - open_window('AddContact', account=account, jid=jid or None) + open_window('AddContact', account=account or None, jid=jid or None) def on_single_message(_action, param): @@ -117,7 +118,7 @@ def on_single_message(_action, param): open_window('SingleMessageWindow', account=account) -def on_add_account(action, _param): +def on_add_account(_action, _param): open_window('AccountWizard') @@ -239,6 +240,7 @@ def on_remove_event(_action, param): # Other Actions + def toggle_ipython(_action, _param): """ Show/hide the ipython window ===================================== gajim/application.py ===================================== @@ -392,6 +392,7 @@ def add_actions(self): actions = [ ('quit', app_actions.on_quit), ('add-account', app_actions.on_add_account), + ('add-contact', app_actions.on_add_contact), ('manage-proxies', app_actions.on_manage_proxies), ('history-manager', app_actions.on_history_manager), ('preferences', app_actions.on_preferences), ===================================== gajim/data/gui/add_contact.ui ===================================== @@ -139,7 +139,7 @@ <property name="visible">True</property> <property name="can-focus">False</property> <property name="halign">end</property> - <property name="label" translatable="yes">Publish Status</property> + <property name="label" translatable="yes">Share Status</property> <style> <class name="dim-label"/> </style> ===================================== gajim/data/gui/contact_info.ui ===================================== @@ -255,7 +255,7 @@ <property name="visible">True</property> <property name="can-focus">False</property> <property name="halign">end</property> - <property name="label" translatable="yes">Disclose my online status</property> + <property name="label" translatable="yes">Share my online status</property> </object> <packing> <property name="expand">False</property> ===================================== gajim/gtk/add_contact.py ===================================== @@ -72,6 +72,7 @@ def __init__(self, account=None, jid=None, nick=None): def _on_button_clicked(self, _assistant, button_name): page = self.get_current_page() + account, _ = self.get_page('address').get_account_and_jid() if button_name == 'next': self._start_disco() @@ -84,7 +85,7 @@ def _on_button_clicked(self, _assistant, button_name): return if button_name == 'add': - client = app.get_client(self.account) + client = app.get_client(account) if page == 'contact': data = self.get_page('contact').get_subscription_data() client.get_module('Presence').subscribe( @@ -97,13 +98,13 @@ def _on_button_clicked(self, _assistant, button_name): self._result.jid, name=self._result.gateway_name, auto_auth=True) - app.window.show_account_page(self.account) + app.window.show_account_page(account) self.destroy() return if button_name == 'join': _, jid = self.get_page('address').get_account_and_jid() - open_window('GroupchatJoin', account=self.account, jid=jid) + open_window('GroupchatJoin', account=account, jid=jid) self.destroy() def _start_disco(self): @@ -192,8 +193,6 @@ def __init__(self, account, jid): self._account = account self._jid = jid - self._client = None - self._ui = get_builder('add_contact.ui') self.add(self._ui.address_box) @@ -201,18 +200,23 @@ def __init__(self, account, jid): self._ui.address_entry.connect('changed', self._set_complete) accounts = app.get_enabled_accounts_with_labels() + liststore = self._ui.account_combo.get_model() + for acc in accounts: + liststore.append(acc) + if len(accounts) > 1: - liststore = self._ui.account_combo.get_model() - for acc in accounts: - liststore.append(acc) self._ui.account_box.show() - if self._account is not None: - self._client = app.get_client(self._account) - self._ui.account_combo.set_active_id(self._account) + if self._account is not None: + self._ui.account_combo.set_active_id(account) + else: + self._ui.account_combo.set_active(0) + else: + # Set to first (and only) item; sets self._account as well + self._ui.account_combo.set_active(0) - if self._jid is not None: - self._ui.address_entry.set_text(self._jid) + if jid is not None: + self._ui.address_entry.set_text(str(jid)) self._set_complete() ===================================== gajim/gtk/roster.py ===================================== @@ -9,6 +9,8 @@ from gi.repository import GLib from gi.repository import Gtk +from nbxmpp import Namespace + from gajim.common import app from gajim.common import ged from gajim.common.const import AvatarSize @@ -114,7 +116,7 @@ def __init__(self, account): def _add_actions(self): actions = [ ('contact-info', self._on_contact_info), - ('modify-transport', self._on_modify_transport), + ('modify-gateway', self._on_modify_gateway), ('execute-command', self._on_execute_command), ('block-contact', self._on_block_contact), ('remove-contact', self._on_remove_contact), @@ -140,7 +142,7 @@ def update_actions(self): app.window.lookup_action( f'contact-info-{self._account}').set_enabled(online) app.window.lookup_action( - f'modify-transport-{self._account}').set_enabled(online) + f'modify-gateway-{self._account}').set_enabled(online) app.window.lookup_action( f'execute-command-{self._account}').set_enabled(online) app.window.lookup_action( @@ -152,7 +154,7 @@ def update_actions(self): def _remove_actions(self): actions = [ 'contact-info', - 'modify-transport', + 'modify-gateway', 'execute-command', 'block-contact', 'remove-contact', @@ -265,7 +267,7 @@ def _on_show_offline(self, action, param): def _on_contact_info(self, _action, param): app.window.contact_info(self._account, param.get_string()) - def _on_modify_transport(self, _action, param): + def _on_modify_gateway(self, _action, param): ServiceRegistration(self._account, param.get_string()) def _on_execute_command(self, _action, param): @@ -345,8 +347,10 @@ def _on_focus_out(treeview, _param): def _show_contact_menu(self, jid, treeview, event): contact = self._client.get_module('Contacts').get_contact(jid) + gateway_register = contact.is_gateway and contact.supports( + Namespace.REGISTER) menu = get_roster_menu( - self._account, jid, transport=contact.is_gateway) + self._account, jid, gateway=gateway_register) rectangle = Gdk.Rectangle() rectangle.x = event.x ===================================== gajim/gui_menu_builder.py ===================================== @@ -152,7 +152,6 @@ def get_account_menu(account): sub menu: list ''' account_menu = [ - ('-add-contact', _('Add Contact…')), ('-profile', _('Profile')), ('-start-single-chat', _('Send Single Message…')), ('-services', _('Discover Services…')), @@ -179,10 +178,7 @@ def build_menu(preset): action, label = item action = 'app.{}{}'.format(account, action) menuitem = Gio.MenuItem.new(label, action) - if 'add-contact' in action: - variant = GLib.Variant('as', [account, '']) - else: - variant = GLib.Variant('s', account) + variant = GLib.Variant('s', account) menuitem.set_action_and_target_value(action, variant) menu.append_item(menuitem) else: @@ -205,15 +201,18 @@ def build_accounts_menu(): accounts_list = sorted(app.settings.get_active_accounts()) if not accounts_list: - modify_account_item = Gio.MenuItem.new(_('_Add Account…'), - 'app.accounts::') - acc_menu.append_item(modify_account_item) + add_account_item = Gio.MenuItem.new(_('_Add Account…'), + 'app.accounts::') + acc_menu.append_item(add_account_item) return if len(accounts_list) > 1: - modify_account_item = Gio.MenuItem.new(_('_Modify Accounts…'), - 'app.accounts::') - acc_menu.append_item(modify_account_item) + modify_accounts_item = Gio.MenuItem.new(_('_Modify Accounts…'), + 'app.accounts::') + acc_menu.append_item(modify_accounts_item) + add_contact_item = Gio.MenuItem.new(_('Add _Contact…'), + 'app.add-contact::') + acc_menu.append_item(add_contact_item) for acc in accounts_list: label = escape_mnemonic(app.get_account_label(acc)) if acc != 'Local': @@ -224,6 +223,9 @@ def build_accounts_menu(): modify_account_item = Gio.MenuItem.new(_('_Modify Account…'), 'app.accounts::') acc_menu.insert_item(0, modify_account_item) + add_contact_item = Gio.MenuItem.new(_('Add _Contact…'), + 'app.add-contact::') + acc_menu.insert_item(1, add_contact_item) menubar.remove(menu_position) menubar.insert_submenu(menu_position, _('Accounts'), acc_menu) @@ -320,7 +322,7 @@ def get_conv_context_menu(account, uri): return menu -def get_roster_menu(account, jid, transport=False): +def get_roster_menu(account, jid, gateway=False): if jid_is_blocked(account, jid): block_label = _('Unblock') else: @@ -331,8 +333,8 @@ def get_roster_menu(account, jid, transport=False): ('block-contact', block_label), ('remove-contact', _('Remove…')), ] - if transport: - menu_items.insert(1, ('modify-transport', _('Modify Transport…'))) + if gateway: + menu_items.insert(1, ('modify-gateway', _('Modify Gateway…'))) menu = Gio.Menu() for item in menu_items: @@ -392,7 +394,7 @@ def get_chat_list_row_menu(workspace_id, account, jid, pinned): is_self_contact = contact.jid.bare == client.get_own_jid().bare if (not contact.is_groupchat and not contact.is_in_roster and not is_self_contact): - menu_items.append(('add-to-roster', _('Add to contact list'))) + menu_items.append(('add-to-roster', _('Add to Contact List…'))) menu = Gio.Menu() for item in menu_items: View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/fa4ecf3d451514d58b9c0107778c34d…
-- View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/fa4ecf3d451514d58b9c0107778c34d…
You're receiving this email because of your account on
dev.gajim.org
.
1
0
0
0
← Newer
1
2
3
4
5
Older →
Jump to page:
1
2
3
4
5
Results per page:
10
25
50
100
200