Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a4a13656 by Philipp Hörist at 2018-09-05T00:59:34Z
Fix license comment format
every linter flags this as an error
- - - - -
30 changed files:
- gajim/adhoc_commands.py
- gajim/advanced_configuration_window.py
- gajim/app_actions.py
- gajim/atom_window.py
- gajim/cell_renderer_image.py
- gajim/chat_control.py
- gajim/chat_control_base.py
- gajim/common/account.py
- gajim/common/app.py
- gajim/common/caps_cache.py
- gajim/common/config.py
- gajim/common/configpaths.py
- gajim/common/connection.py
- gajim/common/connection_handlers.py
- gajim/common/connection_handlers_events.py
- gajim/common/contacts.py
- gajim/common/dbus_support.py
- gajim/common/dh.py
- gajim/common/events.py
- gajim/common/exceptions.py
- gajim/common/fuzzyclock.py
- gajim/common/ged.py
- gajim/common/gpg.py
- gajim/common/helpers.py
- gajim/common/i18n.py
- gajim/common/idle.py
- gajim/common/jingle.py
- gajim/common/jingle_content.py
- gajim/common/jingle_ft.py
- gajim/common/jingle_ftstates.py
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a4a136566f7477e589215efac19eb48d0d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a4a136566f7477e589215efac19eb48d0d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
856a874d by Philipp Hörist at 2018-09-05T00:34:36Z
Fix pyflakes/pycodestyle errors
- - - - -
1 changed file:
- gajim/gtkexcepthook.py
Changes:
=====================================
gajim/gtkexcepthook.py
=====================================
--- a/gajim/gtkexcepthook.py
+++ b/gajim/gtkexcepthook.py
@@ -1,25 +1,21 @@
-# -*- coding:utf-8 -*-
-## gajim/gtkexcepthook.py
-##
-## Copyright (C) 2016-2018 Philipp Hörist <philipp AT hoerist.com>
-## Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
-## Copyright (C) 2005-2014 Yann Leboulanger <asterix AT lagaule.org>
-## Copyright (C) 2008 Stephan Erb <steve-e AT h3c.de>
-##
-## This file is part of Gajim.
-##
-## Gajim is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published
-## by the Free Software Foundation; version 3 only.
-##
-## Gajim is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-##
+# Copyright (C) 2016-2018 Philipp Hörist <philipp AT hoerist.com>
+# Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
+# Copyright (C) 2005-2014 Yann Leboulanger <asterix AT lagaule.org>
+# Copyright (C) 2008 Stephan Erb <steve-e AT h3c.de>
+#
+# This file is part of Gajim.
+#
+# Gajim is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; version 3 only.
+#
+# Gajim is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
@@ -31,8 +27,6 @@ from io import StringIO
from urllib.parse import urlencode
import nbxmpp
-import gi
-gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
try:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/856a874dd5aac864098f37f0fa950bf49b…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/856a874dd5aac864098f37f0fa950bf49b…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9dd747df by Philipp Hörist at 2018-09-05T00:14:51Z
Windows: Fix IPV6 for Windows 10+
Fixes #9326
- - - - -
2 changed files:
- gajim/common/socks5.py
- gajim/common/zeroconf/client_zeroconf.py
Changes:
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -27,6 +27,7 @@ import struct
import hashlib
import os
import time
+import platform
from errno import EWOULDBLOCK
from errno import ENOBUFS
from errno import EINTR
@@ -1424,8 +1425,7 @@ class Socks5Listener(IdleObject):
# Under windows Vista, we need that to listen on ipv6 AND ipv4
# Doesn't work under windows XP
if os.name == 'nt':
- ver = os.sys.getwindowsversion()
- if (ver[3], ver[0]) == (2, 6): # Win Vista +
+ if int(platform.win32_ver()[0]) >= 6: # Win Vista +
# 47 is socket.IPPROTO_IPV6
# 27 is socket.IPV6_V6ONLY under windows, but not defined ...
self._serv.setsockopt(41, 27, 0)
=====================================
gajim/common/zeroconf/client_zeroconf.py
=====================================
--- a/gajim/common/zeroconf/client_zeroconf.py
+++ b/gajim/common/zeroconf/client_zeroconf.py
@@ -27,6 +27,7 @@ from gajim.common.zeroconf import zeroconf
from nbxmpp.protocol import *
import socket
+import platform
import ssl
import errno
import sys
@@ -73,8 +74,7 @@ class ZeroconfListener(IdleObject):
self._serv.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
self._serv.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
if os.name == 'nt':
- ver = os.sys.getwindowsversion()
- if (ver[3], ver[0]) == (2, 6): # Win Vista +
+ if int(platform.win32_ver()[0]) >= 6: # Win Vista +
# 47 is socket.IPPROTO_IPV6
# 27 is socket.IPV6_V6ONLY under windows, but not defined ...
self._serv.setsockopt(41, 27, 0)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9dd747dfe52aa3967c437597c1018d4d5d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9dd747dfe52aa3967c437597c1018d4d5d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a6631398 by Philipp Hörist at 2018-09-04T22:33:08Z
Fix pyflakes/pycodestyle errors
- - - - -
1 changed file:
- gajim/application.py
Changes:
=====================================
gajim/application.py
=====================================
--- a/gajim/application.py
+++ b/gajim/application.py
@@ -1,50 +1,44 @@
-# -*- coding:utf-8 -*-
-## src/gajim.py
-##
-## Copyright (C) 2003-2017 Yann Leboulanger <asterix AT lagaule.org>
-## Copyright (C) 2004-2005 Vincent Hanquez <tab AT snarc.org>
-## Copyright (C) 2005 Alex Podaras <bigpod AT gmail.com>
-## Norman Rasmussen <norman AT rasmussen.co.za>
-## Stéphan Kochen <stephan AT kochen.nl>
-## Copyright (C) 2005-2006 Dimitur Kirov <dkirov AT gmail.com>
-## Alex Mauer <hawke AT hawkesnest.net>
-## Copyright (C) 2005-2007 Travis Shirk <travis AT pobox.com>
-## Nikos Kouremenos <kourem AT gmail.com>
-## Copyright (C) 2006 Junglecow J <junglecow AT gmail.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>
-## James Newton <redshodan AT gmail.com>
-## Copyright (C) 2007-2008 Brendan Taylor <whateley AT gmail.com>
-## Julien Pivotto <roidelapluie AT gmail.com>
-## Stephan Erb <steve-e AT h3c.de>
-## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
-## Copyright (C) 2016-2017 Emmanuel Gil Peyrot <linkmauve AT linkmauve.fr>
-## Philipp Hörist <philipp AT hoerist.com>
-##
-## This file is part of Gajim.
-##
-## Gajim is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published
-## by the Free Software Foundation; version 3 only.
-##
-## Gajim is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-##
+# Copyright (C) 2003-2017 Yann Leboulanger <asterix AT lagaule.org>
+# Copyright (C) 2004-2005 Vincent Hanquez <tab AT snarc.org>
+# Copyright (C) 2005 Alex Podaras <bigpod AT gmail.com>
+# Norman Rasmussen <norman AT rasmussen.co.za>
+# Stéphan Kochen <stephan AT kochen.nl>
+# Copyright (C) 2005-2006 Dimitur Kirov <dkirov AT gmail.com>
+# Alex Mauer <hawke AT hawkesnest.net>
+# Copyright (C) 2005-2007 Travis Shirk <travis AT pobox.com>
+# Nikos Kouremenos <kourem AT gmail.com>
+# Copyright (C) 2006 Junglecow J <junglecow AT gmail.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>
+# James Newton <redshodan AT gmail.com>
+# Copyright (C) 2007-2008 Brendan Taylor <whateley AT gmail.com>
+# Julien Pivotto <roidelapluie AT gmail.com>
+# Stephan Erb <steve-e AT h3c.de>
+# Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
+# Copyright (C) 2016-2017 Emmanuel Gil Peyrot <linkmauve AT linkmauve.fr>
+# Philipp Hörist <philipp AT hoerist.com>
+#
+# This file is part of Gajim.
+#
+# Gajim is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; version 3 only.
+#
+# Gajim is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import sys
-import os
from urllib.parse import unquote
from gi.repository import GLib, Gio, Gtk
from gajim.common import app
-from gajim.common import i18n
from gajim.common import configpaths
from gajim.common import logging_helpers
from gajim.common import exceptions
@@ -56,47 +50,91 @@ class GajimApplication(Gtk.Application):
'''Main class handling activation and command line.'''
def __init__(self):
- Gtk.Application.__init__(self, application_id='org.gajim.Gajim',
- flags=(
- Gio.ApplicationFlags.HANDLES_COMMAND_LINE |
- Gio.ApplicationFlags.HANDLES_OPEN))
-
- self.add_main_option('version', ord('V'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Show the application\'s version'))
- self.add_main_option('quiet', ord('q'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Show only critical errors'))
- self.add_main_option('separate', ord('s'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Separate profile files completely (even '
- 'history database and plugins)'))
- self.add_main_option('verbose', ord('v'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Print XML stanzas and other debug '
- 'information'))
- self.add_main_option('profile', ord('p'), GLib.OptionFlags.NONE,
- GLib.OptionArg.STRING,
- _('Use defined profile in configuration '
- 'directory'), 'NAME')
- self.add_main_option('config-path', ord('c'), GLib.OptionFlags.NONE,
- GLib.OptionArg.STRING,
- _('Set configuration directory'), 'PATH')
- self.add_main_option('loglevel', ord('l'), GLib.OptionFlags.NONE,
- GLib.OptionArg.STRING,
- _('Configure logging system'), 'LEVEL')
- self.add_main_option('warnings', ord('w'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Show all warnings'))
- self.add_main_option('ipython', ord('i'), GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Open IPython shell'))
- self.add_main_option('show-next-pending-event', 0, GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Pops up a window with the next pending event'))
- self.add_main_option('start-chat', 0, GLib.OptionFlags.NONE,
- GLib.OptionArg.NONE,
- _('Start a new chat'))
+ flags = (Gio.ApplicationFlags.HANDLES_COMMAND_LINE |
+ Gio.ApplicationFlags.HANDLES_OPEN)
+ Gtk.Application.__init__(self,
+ application_id='org.gajim.Gajim',
+ flags=flags)
+
+ self.add_main_option(
+ 'version',
+ ord('V'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Show the application\'s version'))
+
+ self.add_main_option(
+ 'quiet',
+ ord('q'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Show only critical errors'))
+
+ self.add_main_option(
+ 'separate',
+ ord('s'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Separate profile files completely '
+ '(even history database and plugins)'))
+
+ self.add_main_option(
+ 'verbose',
+ ord('v'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Print XML stanzas and other debug information'))
+
+ self.add_main_option(
+ 'profile',
+ ord('p'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.STRING,
+ _('Use defined profile in configuration directory'),
+ 'NAME')
+
+ self.add_main_option(
+ 'config-path',
+ ord('c'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.STRING,
+ _('Set configuration directory'),
+ 'PATH')
+
+ self.add_main_option(
+ 'loglevel',
+ ord('l'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.STRING,
+ _('Configure logging system'),
+ 'LEVEL')
+
+ self.add_main_option(
+ 'warnings',
+ ord('w'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Show all warnings'))
+
+ self.add_main_option(
+ 'ipython',
+ ord('i'),
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Open IPython shell'))
+
+ self.add_main_option(
+ 'show-next-pending-event',
+ 0,
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Pops up a window with the next pending event'))
+
+ self.add_main_option(
+ 'start-chat', 0,
+ GLib.OptionFlags.NONE,
+ GLib.OptionArg.NONE,
+ _('Start a new chat'))
self.add_main_option_entries(self._get_remaining_entry())
@@ -186,11 +224,12 @@ class GajimApplication(Gtk.Application):
attributes = cmd.split(';')
message = None
for key in attributes:
- if key.startswith('body'):
- try:
- message = unquote(key.split('=')[1])
- except Exception:
- app.log('uri_handler').error('Invalid URI: %s', cmd)
+ if not key.startswith('body'):
+ continue
+ try:
+ message = unquote(key.split('=')[1])
+ except Exception:
+ app.log('uri_handler').error('Invalid URI: %s', cmd)
accounts = list(app.connections.keys())
if not accounts:
continue
@@ -339,33 +378,31 @@ class GajimApplication(Gtk.Application):
self.add_account_actions(accounts_list[0])
def _get_account_actions(self, account):
- from gajim import app_actions
+ from gajim import app_actions as a
if account == 'Local':
return [
- ('-xml-console', app_actions.on_xml_console, 'always', 's')
+ ('-xml-console', a.on_xml_console, 'always', 's')
]
return [
- ('-start-single-chat', app_actions.on_single_message, 'online', 's'),
- ('-join-groupchat', app_actions.on_join_gc, 'online', 's'),
- ('-add-contact', app_actions.on_add_contact, 'online', 's'),
- ('-services', app_actions.on_service_disco, 'online', 's'),
- ('-profile', app_actions.on_profile, 'feature', 's'),
- ('-xml-console', app_actions.on_xml_console, 'always', 's'),
- ('-server-info', app_actions.on_server_info, 'online', 's'),
- ('-archive', app_actions.on_mam_preferences, 'feature', 's'),
- ('-sync-history', app_actions.on_history_sync, 'online', 's'),
- ('-privacylists', app_actions.on_privacy_lists, 'feature', 's'),
- ('-send-server-message',
- app_actions.on_send_server_message, 'online', 's'),
- ('-set-motd', app_actions.on_set_motd, 'online', 's'),
- ('-update-motd', app_actions.on_update_motd, 'online', 's'),
- ('-delete-motd', app_actions.on_delete_motd, 'online', 's'),
- ('-activate-bookmark',
- app_actions.on_activate_bookmark, 'online', 'a{sv}'),
- ('-open-event', app_actions.on_open_event, 'always', 'a{sv}'),
- ('-import-contacts', app_actions.on_import_contacts, 'online', 's'),
+ ('-start-single-chat', a.on_single_message, 'online', 's'),
+ ('-join-groupchat', a.on_join_gc, 'online', 's'),
+ ('-add-contact', a.on_add_contact, 'online', 's'),
+ ('-services', a.on_service_disco, 'online', 's'),
+ ('-profile', a.on_profile, 'feature', 's'),
+ ('-xml-console', a.on_xml_console, 'always', 's'),
+ ('-server-info', a.on_server_info, 'online', 's'),
+ ('-archive', a.on_mam_preferences, 'feature', 's'),
+ ('-sync-history', a.on_history_sync, 'online', 's'),
+ ('-privacylists', a.on_privacy_lists, 'feature', 's'),
+ ('-send-server-message', a.on_send_server_message, 'online', 's'),
+ ('-set-motd', a.on_set_motd, 'online', 's'),
+ ('-update-motd', a.on_update_motd, 'online', 's'),
+ ('-delete-motd', a.on_delete_motd, 'online', 's'),
+ ('-activate-bookmark', a.on_activate_bookmark, 'online', 'a{sv}'),
+ ('-open-event', a.on_open_event, 'always', 'a{sv}'),
+ ('-import-contacts', a.on_import_contacts, 'online', 's'),
]
def add_account_actions(self, account):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a6631398f7a7214861f8d5b9f64132bdc0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a6631398f7a7214861f8d5b9f64132bdc0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a9a115d3 by Philipp Hörist at 2018-09-02T21:31:42Z
Fix highlight on messages without time
- - - - -
1 changed file:
- gajim/groupchat_control.py
Changes:
=====================================
gajim/groupchat_control.py
=====================================
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -1438,7 +1438,7 @@ class GroupchatControl(ChatControlBase):
sound = 'received'
# Is it a history message? Don't want sound-floods when we join.
- if time.mktime(time.localtime()) - tim > 1:
+ if tim is not None and time.mktime(time.localtime()) - tim > 1:
sound = None
return (highlight, sound)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a9a115d359094fd969f75f85faa48dccae…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a9a115d359094fd969f75f85faa48dccae…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
7d723d7b by Philipp Hörist at 2018-09-01T10:44:45Z
Fix contact not beeing found after room destroy
- - - - -
1 changed file:
- gajim/common/contacts.py
Changes:
=====================================
gajim/common/contacts.py
=====================================
--- a/gajim/common/contacts.py
+++ b/gajim/common/contacts.py
@@ -469,7 +469,7 @@ class Contacts():
self._contacts = {}
def add_contact(self, contact):
- if contact.jid not in self._contacts:
+ if contact.jid not in self._contacts or contact.is_groupchat():
self._contacts[contact.jid] = [contact]
return
contacts = self._contacts[contact.jid]
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7d723d7b9846c0226b4c0d3b068e08b772…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7d723d7b9846c0226b4c0d3b068e08b772…
You're receiving this email because of your account on dev.gajim.org.