Philipp Hörist pushed to branch gajim_1.0 at gajim / gajim
Commits: a8f6c520 by Sebastian Wagner at 2018-03-14T22:40:54+01:00 Defer txt record lookup until connection attempt
Don't try to resolve _xmppconnect records for servers before trying to connect. Prevent warnings from gajim.c.resolver for accounts with "connect on startup" disabled.
- - - - - accd4d93 by Daniel at 2018-03-14T22:41:13+01:00 Handle geo:-URIs
- - - - - 641c0d7c by Daniel at 2018-03-14T22:41:23+01:00 Use https for OpenStreetMap URIs built from PEP
- - - - - 36ea158b by Yann Leboulanger at 2018-03-14T22:41:45+01:00 fix traceback at end of file transfer. Fixes #8932
- - - - - 26c10d59 by Yann Leboulanger at 2018-03-14T22:42:13+01:00 Use hide_groupchat_occupants_list option to decide if we show the occupant list or not. Fixes #8922
- - - - - d224a85b by Yann Leboulanger at 2018-03-14T22:42:32+01:00 prevent traceback when pressing tab in groupchat. Fixes #8933
- - - - - 907e9645 by Philipp Hörist at 2018-03-14T22:42:54+01:00 Fix roster tooltip
Fixes #8924
Its not clear at this point why we dont find a contact is None, so log output is added
- - - - - 45deedda by Philipp Hörist at 2018-03-14T22:43:19+01:00 Add logging to tooltips
- - - - - 97ee232b by Yann Leboulanger at 2018-03-14T22:43:42+01:00 update SHA256 checksum of plugin_installer plugin. Fixes #8904, #8884
- - - - - dc1ea0e4 by Philipp Hörist at 2018-03-14T22:44:00+01:00 Raise correct dialog on account removal
Fixes #8941
- - - - - 0ef3fc69 by Philipp Hörist at 2018-03-14T22:44:11+01:00 Fix transients on some Dialogs
- - - - - 23d4c4a0 by Philipp Hörist at 2018-03-14T22:44:21+01:00 Add transient argument to Dialogs
- - - - - 939ac729 by Philipp Hörist at 2018-03-14T22:44:31+01:00 Disable ZeroConf account by default
- - - - - 23890551 by Philipp Hörist at 2018-03-14T22:44:59+01:00 Add roster tooltip extension point
- - - - - a1f40711 by Philipp Hörist at 2018-03-14T22:45:07+01:00 Add pybonjour to Windows build
- - - - - c1557eec by Philipp Hörist at 2018-03-14T22:45:16+01:00 Deactivate httpupload for zeroconf
- - - - - 5ba5b404 by Yann Leboulanger at 2018-03-14T22:45:31+01:00 strip muc server name before discovering it. Fixes #8886
- - - - - 837add58 by Philipp Hörist at 2018-03-14T22:45:46+01:00 Remove CAN_OVERRIDE_APP_ID Flag
This cannot be used in combination with HANDLES_COMMAND_LINE
Fixes #8947
- - - - -
15 changed files:
- gajim/accounts_window.py - gajim/chat_control.py - gajim/common/connection.py - gajim/common/socks5.py - gajim/common/zeroconf/connection_zeroconf.py - gajim/config.py - gajim/conversation_textview.py - gajim/dialogs.py - gajim/gajim.py - gajim/groupchat_control.py - gajim/gui_interface.py - gajim/roster_window.py - gajim/tooltips.py - org.gajim.Gajim.json - win/dev_env.sh
Changes:
===================================== gajim/accounts_window.py ===================================== --- a/gajim/accounts_window.py +++ b/gajim/accounts_window.py @@ -177,7 +177,7 @@ class AccountsWindow(Gtk.ApplicationWindow):
def on_remove_account(self, button, account): if app.events.get_events(account): - app.interface.raise_dialog('unread-events-on-remove') + app.interface.raise_dialog('unread-events-on-remove-account') return
if app.config.get_per('accounts', account, 'is_zeroconf'): @@ -211,7 +211,8 @@ class AccountsWindow(Gtk.ApplicationWindow): _('You have opened chat in account %s') % account, _('All chat and groupchat windows will be closed. ' 'Do you want to continue?'), - on_response_ok=(remove, account)) + on_response_ok=(remove, account), + transient_for=self) else: remove(account)
===================================== gajim/chat_control.py ===================================== --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -602,7 +602,7 @@ class ChatControl(ChatControlBase): if 'location' in self.contact.pep: location = self.contact.pep['location']._pep_specific_data if ('lat' in location) and ('lon' in location): - uri = 'http://www.openstreetmap.org/?' + \ + uri = 'https://www.openstreetmap.org/?' + \ 'mlat=%(lat)s&mlon=%(lon)s&zoom=16' % {'lat': location['lat'], 'lon': location['lon']} helpers.launch_browser_mailer('url', uri)
===================================== gajim/common/connection.py ===================================== --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -709,11 +709,6 @@ class Connection(CommonConnection, ConnectionHandlers): self._nec_gc_stanza_message_outgoing) app.ged.register_event_handler('stanza-message-outgoing', ged.OUT_CORE, self._nec_stanza_message_outgoing) - - h = app.config.get_per('accounts', self.name, 'hostname') - if h: - app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h), - self._on_resolve_txt, type_='txt') # END __init__
def cleanup(self): @@ -1093,6 +1088,10 @@ class Connection(CommonConnection, ConnectionHandlers): ] self._hostname = hostname
+ if h: + app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h), + self._on_resolve_txt, type_='txt') + if use_srv and self._proxy is None: self._srv_hosts = []
===================================== gajim/common/socks5.py ===================================== --- a/gajim/common/socks5.py +++ b/gajim/common/socks5.py @@ -423,7 +423,7 @@ class SocksQueue: connections with 1 """ if idx != -1: - for key in self.senders.keys(): + for key in list(self.senders.keys()): if idx in key: self.remove_sender_by_key(key, do_disconnect=do_disconnect) if not remove_all:
===================================== gajim/common/zeroconf/connection_zeroconf.py ===================================== --- a/gajim/common/zeroconf/connection_zeroconf.py +++ b/gajim/common/zeroconf/connection_zeroconf.py @@ -64,6 +64,7 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf): # we don't need a password, but must be non-empty self.password = 'zeroconf' self.autoconnect = False + self.httpupload = False
CommonConnection.__init__(self, name) self.is_zeroconf = True @@ -76,24 +77,6 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf): Get name, host, port from config, or create zeroconf account with default values """ - if not app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'name'): - log.debug('Creating zeroconf account') - app.config.add_per('accounts', app.ZEROCONF_ACC_NAME) - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, - 'autoconnect', True) - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'no_log_for', - '') - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'password', - 'zeroconf') - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, - 'sync_with_global_status', True) - - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, - 'custom_port', 5298) - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, - 'is_zeroconf', True) - app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, - 'use_ft_proxies', False) self.host = socket.gethostname() app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'hostname', self.host)
===================================== gajim/config.py ===================================== --- a/gajim/config.py +++ b/gajim/config.py @@ -1774,7 +1774,8 @@ class RemoveAccountWindow: self.account = account xml = gtkgui_helpers.get_gtk_builder('remove_account_window.ui') self.window = xml.get_object('remove_account_window') - self.window.set_transient_for(app.interface.roster.window) + active_window = app.app.get_active_window() + self.window.set_transient_for(active_window) self.remove_and_unregister_radiobutton = xml.get_object( 'remove_and_unregister_radiobutton') self.window.set_title(_('Removing %s account') % self.account) @@ -1794,7 +1795,8 @@ class RemoveAccountWindow: dialogs.ErrorDialog( _('Account is disabled'), _('To unregister from a server, account must be ' - 'enabled.')) + 'enabled.'), + transient_for=self.window) return if not app.connections[self.account].password: def on_ok(passphrase, checked): @@ -1808,7 +1810,8 @@ class RemoveAccountWindow: dialogs.PassphraseDialog( _('Password Required'), _('Enter your password for account %s') % self.account, - _('Save password'), ok_handler=on_ok) + _('Save password'), ok_handler=on_ok, + transient_for=self.window) return app.connections[self.account].unregister_account( self._on_remove_success) @@ -1820,7 +1823,8 @@ class RemoveAccountWindow: dialogs.ConfirmationDialog( _('Account "%s" is connected to the server') % self.account, _('If you remove it, the connection will be lost.'), - on_response_ok=remove) + on_response_ok=remove, + transient_for=self.window) else: remove()
@@ -1837,7 +1841,8 @@ class RemoveAccountWindow: _('What would you like to do?'), _('Remove only from Gajim'), _('Don't remove anything. I'll try again later'), - on_response_ok=self.on_remove_responce_ok, is_modal=False) + on_response_ok=self.on_remove_responce_ok, is_modal=False, + transient_for=self.window) return # Close all opened windows app.interface.roster.close_all(self.account, force=True) @@ -2265,7 +2270,8 @@ class AccountCreationWizardWindow: self.xml = gtkgui_helpers.get_gtk_builder( 'account_creation_wizard_window.ui') self.window = self.xml.get_object('account_creation_wizard_window') - self.window.set_transient_for(app.interface.roster.window) + active_window = app.app.get_active_window() + self.window.set_transient_for(active_window)
# Connect events from comboboxtext_entry server_comboboxtext = self.xml.get_object('server_comboboxtext')
===================================== gajim/conversation_textview.py ===================================== --- a/gajim/conversation_textview.py +++ b/gajim/conversation_textview.py @@ -801,6 +801,17 @@ class ConversationTextview(GObject.GObject): self.on_start_chat_activate(None, jid) else: self.on_start_chat_activate(None, word) + # handle geo:-URIs + elif word[:4] == 'geo:': + location = word[4:] + lat, _, lon = location.partition(',') + if lon == '': + return + uri = 'https://www.openstreetmap.org/?' \ + 'mlat=%(lat)s&mlon=%(lon)s&zoom=16' % \ + {'lat': lat, 'lon': lon} + helpers.launch_browser_mailer(kind, uri) + # other URIs else: helpers.launch_browser_mailer(kind, word)
===================================== gajim/dialogs.py ===================================== --- a/gajim/dialogs.py +++ b/gajim/dialogs.py @@ -230,7 +230,7 @@ class PassphraseDialog: Class for Passphrase dialog """ def __init__(self, titletext, labeltext, checkbuttontext=None, - ok_handler=None, cancel_handler=None): + ok_handler=None, cancel_handler=None, transient_for=None): self.xml = gtkgui_helpers.get_gtk_builder('passphrase_dialog.ui') self.window = self.xml.get_object('passphrase_dialog') self.passphrase_entry = self.xml.get_object('passphrase_entry') @@ -248,7 +248,9 @@ class PassphraseDialog: cancelbutton.connect('clicked', self.on_cancelbutton_clicked)
self.xml.connect_signals(self) - self.window.set_transient_for(app.interface.roster.window) + if transient_for is None: + transient_for = app.app.get_active_window() + self.window.set_transient_for(transient_for) self.window.show_all()
self.check = bool(checkbuttontext) @@ -1856,15 +1858,13 @@ class ConfirmationDialogDoubleRadio(ConfirmationDialog): """
def __init__(self, pritext, sectext='', radiotext1='', radiotext2='', - on_response_ok=None, on_response_cancel=None, is_modal=True): + on_response_ok=None, on_response_cancel=None, is_modal=True, transient_for=None): self.user_response_ok = on_response_ok self.user_response_cancel = on_response_cancel
- if hasattr(app.interface, 'roster') and app.interface.roster: - parent = app.interface.roster.window - else: - parent = None - HigDialog.__init__(self, parent, Gtk.MessageType.QUESTION, + if transient_for is None: + transient_for = app.app.get_active_window() + HigDialog.__init__(self, transient_for, Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, pritext, sectext, self.on_response_ok, self.on_response_cancel)
@@ -2573,7 +2573,7 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow): self._nec_agent_info_error_received)
def _on_search_clicked(self, widget): - server = self.server_combo.get_active_text() + server = self.server_combo.get_active_text().strip() self.requested_jid = server app.connections[self.account].discoverInfo(server)
===================================== gajim/gajim.py ===================================== --- a/gajim/gajim.py +++ b/gajim/gajim.py @@ -67,8 +67,7 @@ class GajimApplication(Gtk.Application): Gtk.Application.__init__(self, application_id='org.gajim.Gajim', flags=( Gio.ApplicationFlags.HANDLES_COMMAND_LINE | - Gio.ApplicationFlags.HANDLES_OPEN | - Gio.ApplicationFlags.CAN_OVERRIDE_APP_ID)) + Gio.ApplicationFlags.HANDLES_OPEN))
self.add_main_option('version', ord('V'), GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
===================================== gajim/groupchat_control.py ===================================== --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -368,8 +368,6 @@ class GroupchatControl(ChatControlBase):
self.widget_set_visible(self.xml.get_object('banner_eventbox'), app.config.get('hide_groupchat_banner')) - self.widget_set_visible(self.xml.get_object('list_scrolledwindow'), - app.config.get('hide_groupchat_occupants_list'))
self._last_selected_contact = None # None or holds jid, account tuple
@@ -409,9 +407,10 @@ class GroupchatControl(ChatControlBase): id_ = self.hpaned.connect('notify', self.on_hpaned_notify) self.handlers[id_] = self.hpaned
- # Hide the Roster per default - self.hpaned.get_child2().set_no_show_all(True) - self.hpaned.get_child2().hide() + if app.config.get('hide_groupchat_occupants_list'): + # Hide the roster by default + self.hpaned.get_child2().set_no_show_all(True) + self.hpaned.get_child2().hide()
# set the position of the current hpaned hpaned_position = app.config.get('gc-hpaned-position') @@ -2399,7 +2398,8 @@ class GroupchatControl(ChatControlBase): list_nick.remove(nick) list_nick.insert(0, nick)
- list_nick.remove(self.nick) # Skip self + if self.nick in list_nick: + list_nick.remove(self.nick) # Skip self for nick in list_nick: fjid = self.room_jid + '/' + nick if nick.lower().startswith(begin.lower()) and not \
===================================== gajim/gui_interface.py ===================================== --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2658,6 +2658,29 @@ class Interface: log.info('Disconnect %s', connection.name) connection.disconnectedReconnCB()
+ def create_zeroconf_default_config(self): + if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'name'): + return + log.info('Creating zeroconf account') + app.config.add_per('accounts', app.ZEROCONF_ACC_NAME) + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'autoconnect', True) + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'no_log_for', + '') + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, 'password', + 'zeroconf') + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'sync_with_global_status', True) + + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'custom_port', 5298) + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'is_zeroconf', True) + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'use_ft_proxies', False) + app.config.set_per('accounts', app.ZEROCONF_ACC_NAME, + 'active', False) + def run(self, application): if app.config.get('trayicon') != 'never': self.show_systray() @@ -2839,6 +2862,7 @@ class Interface: self.create_core_handlers_list() self.register_core_handlers()
+ self.create_zeroconf_default_config() if app.config.get_per('accounts', app.ZEROCONF_ACC_NAME, 'active') \ and app.HAVE_ZEROCONF: app.connections[app.ZEROCONF_ACC_NAME] = \
===================================== gajim/roster_window.py ===================================== --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -5886,10 +5886,6 @@ class RosterWindow: # Open wizard only after roster is created, so we can make it # transient for the roster window GLib.idle_add(_open_wizard) - if not app.ZEROCONF_ACC_NAME in app.config.get_per('accounts'): - # Create zeroconf in config file - from gajim.common.zeroconf import connection_zeroconf - connection_zeroconf.ConnectionZeroconf(app.ZEROCONF_ACC_NAME)
# Setting CTRL+J to be the shortcut for bringing up the dialog to join a # conference.
===================================== gajim/tooltips.py ===================================== --- a/gajim/tooltips.py +++ b/gajim/tooltips.py @@ -30,6 +30,7 @@
import os import time +import logging from datetime import datetime
from gi.repository import Gtk @@ -43,6 +44,8 @@ from gajim.common import app from gajim.common import helpers from gajim.common.i18n import Q_
+log = logging.getLogger('gajim.tooltips') +
class StatusTable: """ @@ -413,6 +416,10 @@ class RosterTooltip(Gtk.Window, StatusTable): # Username/Account/Groupchat self.prim_contact = app.contacts.get_highest_prio_contact_from_contacts( contacts) + if self.prim_contact is None: + log.error('No contact for Roster tooltip found') + log.error('contacts: %s, typ: %s, account: %s', contacts, typ, account) + return self.contact_jid = self.prim_contact.jid name = GLib.markup_escape_text(self.prim_contact.get_shown_name()) name_markup = '<b>{}</b>'.format(name) @@ -534,6 +541,9 @@ class RosterTooltip(Gtk.Window, StatusTable): self.avatar.set_from_surface(surface) self.avatar.show()
+ app.plugin_manager.gui_extension_point( + 'roster_tooltip_populate', self, contacts, self.tooltip_grid) + # Sets the Widget that is at the bottom to expand. # This is needed in case the Picture takes more Space then the Labels i = 1
===================================== org.gajim.Gajim.json ===================================== --- a/org.gajim.Gajim.json +++ b/org.gajim.Gajim.json @@ -359,7 +359,7 @@ { "type": "archive", "url": "https://ftp.gajim.org/plugins_1/plugin_installer.zip", - "sha256": "7d5dcd9a5e05d214ca85651784bda732aac3b5c363a6e23529e6e777f9d24d42", + "sha256": "a4ee63a4b7fd213236f30f23ff0535d63bad2fd276363d4ac8d320da63d4d09c", "dest": "gajim/data/plugins/plugin_installer" } ]
===================================== win/dev_env.sh ===================================== --- a/win/dev_env.sh +++ b/win/dev_env.sh @@ -22,6 +22,7 @@ function main { pyasn1 certifi git+https://dev.gajim.org/gajim/python-nbxmpp.git +git+https://dev.gajim.org/lovetox/pybonjour-python3.git protobuf git+https://github.com/dlitz/pycrypto.git cryptography
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/7cac6432217cc90db75affa055069d19e2...
--- View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/7cac6432217cc90db75affa055069d19e2... You're receiving this email because of your account on dev.gajim.org.