Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
d8bba454 by Emmanuel Gil Peyrot at 2017-12-15T02:34:45+01:00
Fix Gajim’s .desktop file to pass the URI to the program.
- - - - -
1959b486 by Emmanuel Gil Peyrot at 2017-12-15T02:34:45+01:00
Remove gajim-remote.desktop, its URI handling is now done in Gajim itself.
- - - - -
d858ff51 by Yann Leboulanger at 2017-12-15T08:29:37+01:00
Merge branch 'remove-gajim-remote-desktop' into 'master'
Remove gajim-remote.desktop and fix gajim.desktop
See merge request gajim/gajim!169
- - - - -
3 changed files:
- − data/gajim-remote.desktop.in
- data/org.gajim.Gajim.desktop.in
- setup.py
Changes:
=====================================
data/gajim-remote.desktop.in deleted
=====================================
--- a/data/gajim-remote.desktop.in
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Categories=Network;InstantMessaging;RemoteAccess;ConsoleOnly;
-Name=Open URI using Gajim
-# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
-Keywords=chat;messaging;im;jabber;xmpp;bonjour;voip;
-Version=1.0
-Exec=gajim-remote handle_uri %u
-TryExec=gajim-remote
-StartupNotify=false
-Terminal=false
-Type=Application
-NoDisplay=true
=====================================
data/org.gajim.Gajim.desktop.in
=====================================
--- a/data/org.gajim.Gajim.desktop.in
+++ b/data/org.gajim.Gajim.desktop.in
@@ -6,7 +6,7 @@ Comment=A GTK+ Jabber client
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=chat;messaging;im;xmpp;bonjour;voip;
Version=1.0
-Exec=gajim
+Exec=gajim %u
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gajim.Gajim
StartupNotify=true
=====================================
setup.py
=====================================
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,6 @@ def update_trans():
template = os.path.join('po', 'gajim.pot')
files = [os.path.join(root, f) for root, d, files in os.walk('gajim') for f in files if os.path.isfile(
os.path.join(root, f)) and (f.endswith('.py') or f.endswith('.ui'))]
- files.append(os.path.join("data", "gajim-remote.desktop.in"))
files.append(os.path.join("data", "org.gajim.Gajim.desktop.in"))
files.append(os.path.join("data", "org.gajim.Gajim.appdata.xml.in"))
cmd = 'xgettext --from-code=utf-8 -o %s %s' % (
@@ -116,7 +115,6 @@ def build_intl(build_cmd):
base = build_dir
merge_files = (('data/org.gajim.Gajim.desktop', 'share/applications', '--desktop'),
- ('data/gajim-remote.desktop', 'share/applications', '--desktop'),
('data/org.gajim.Gajim.appdata.xml', 'share/metainfo', '--xml'))
for filename, target, option in merge_files:
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/4009625e02c08e1adfb66557648a2cbf7…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/4009625e02c08e1adfb66557648a2cbf7…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
5364c198 by André Apitzsch at 2017-12-09T15:04:15+01:00
Port logind_listener to GTK dbus
- - - - -
4e7fcea2 by Yann Leboulanger at 2017-12-13T21:57:57+01:00
Merge branch 'logind' into 'master'
Port logind_listener to GTK dbus
See merge request gajim/gajim!167
- - - - -
2 changed files:
- gajim/gui_interface.py
- gajim/logind_listener.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2852,8 +2852,7 @@ class Interface:
self.remote_ctrl = None
- if dbus_support.supported:
- from gajim import logind_listener
+ from gajim import logind_listener
# Handle gnome screensaver
if dbus_support.supported:
=====================================
gajim/logind_listener.py
=====================================
--- a/gajim/logind_listener.py
+++ b/gajim/logind_listener.py
@@ -25,23 +25,29 @@ Documentation: http://www.freedesktop.org/wiki/Software/systemd/inhibit
import os
import logging
-from gajim.common import dbus_support
+from gi.repository import Gio, GLib
+
from gajim.common import app
log = logging.getLogger('gajim.logind_listener')
-supported = False
-fd = -1 # file descriptor of the inhibitor; negative number means we don't
- # hold any (yet)
+
+# file descriptor of the inhibitor; negative number means we don't
+# hold any (yet)
+fd = -1
-def on_suspend(active):
+def signal_received(connection, sender_name, object_path,
+ interface_name, signal_name, parameters, *user_data):
'''Signal handler for suspend event'''
global fd
- if not active:
- # we just resumed, we should take another inhibitor
- get_inhibitor()
+ connected = None
+ log.info('Signal received: %s - %s', interface_name, parameters)
+
+ # signal is sent right before (with the parameter True) and after
+ # (with the parameter False) the system goes down for suspend/hibernate
+ if not parameters[0]:
return
# we're going for suspend, let's disconnect
@@ -62,53 +68,54 @@ def on_suspend(active):
# something is wrong, the system is suspending but we don't have
# a lock file
log.warning("System suspend detected, but we don't seem to be holding "
- "a file descriptor for sleep inihibitor")
+ "a file descriptor for sleep inihibitor")
+
-def get_inhibitor():
+def get_inhibitor(connection):
'''Ask for a suspend delay inhibitor'''
- from gajim.common.dbus_support import system_bus, dbus
- bus = system_bus.bus()
global fd
if fd >= 0:
# someting is wrong, we haven't closed the previous file descriptor
# and we ask for yet another one
log.warning('We are about to ask for a sleep inhibitor, but we seem '
- 'to be holding one already')
-
- login_object = bus.get_object('org.freedesktop.login1',
- '/org/freedesktop/login1')
- login_manager = dbus.Interface(login_object,
- 'org.freedesktop.login1.Manager')
-
- ret = login_manager.Inhibit('sleep', 'Gajim', 'Disconnect from the network',
- 'delay')
- fd = ret.take()
-
-def set_listener():
- '''Set up a listener for suspend signals
-
- @return bool whether it succeeded
- '''
- from gajim.common.dbus_support import system_bus
- bus = system_bus.bus()
-
- if not 'org.freedesktop.login1' in bus.list_names():
- # logind is not present
- log.debug("logind is not on D-Bus, not activating logind listener")
- return False
-
- bus.add_signal_receiver(on_suspend, signal_name='PrepareForSleep',
- bus_name='org.freedesktop.login1',
- path='/org/freedesktop/login1',
- dbus_interface='org.freedesktop.login1.Manager')
- return True
-
-if dbus_support.supported:
- try:
- if set_listener():
- get_inhibitor()
- supported = True
- except Exception as ex:
- log.error("A problem occured while activating logind listener")
+ 'to be holding one already')
+
+ ret = connection.call_sync(
+ 'org.freedesktop.login1',
+ '/org/freedesktop/login1',
+ 'org.freedesktop.login1.Manager',
+ 'Inhibit',
+ GLib.Variant('(ssss)', ('sleep', 'org.gajim.Gajim',
+ 'Disconnect from the network', 'delay')),
+ None,
+ Gio.DBusCallFlags.NONE, -1, None)
+
+ fd = ret[0]
+
+
+def appeared(connection, name, name_owner, *user_data):
+ '''Set up a listener for suspend signals'''
+ global supported
+ supported = True
+ log.info('%s appeared', name)
+ if name == 'org.freedesktop.login1':
+ connection.signal_subscribe(
+ 'org.freedesktop.login1',
+ 'org.freedesktop.login1.Manager',
+ 'PrepareForSleep',
+ '/org/freedesktop/login1',
+ None,
+ Gio.DBusSignalFlags.NONE,
+ signal_received,
+ None)
+ get_inhibitor(connection)
+
+
+Gio.bus_watch_name(
+ Gio.BusType.SYSTEM,
+ 'org.freedesktop.login1',
+ Gio.BusNameWatcherFlags.NONE,
+ appeared,
+ None)
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/a39d68d4aeb5402fdf48f49df2cc82e63…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/a39d68d4aeb5402fdf48f49df2cc82e63…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
a39d68d4 by Yann Leboulanger at 2017-12-11T21:13:53+01:00
when internet connection is back, only connect accounts that were
connected before connection broke
- - - - -
1 changed file:
- gajim/gui_interface.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2622,7 +2622,7 @@ class Interface:
self.network_state = connected
if connected:
for connection in app.connections.values():
- if connection.connected <= 0:
+ if connection.connected <= 0 and connection.time_to_reconnect:
log.info('Connect %s', connection.name)
connection.reconnect()
else:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a39d68d4aeb5402fdf48f49df2cc82e636…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a39d68d4aeb5402fdf48f49df2cc82e636…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
f005d610 by Philipp Hörist at 2017-12-11T18:49:55+01:00
Load client certs in binary mode
Fixes #46
- - - - -
1 changed file:
- nbxmpp/tls_nb.py
Changes:
=====================================
nbxmpp/tls_nb.py
=====================================
--- a/nbxmpp/tls_nb.py
+++ b/nbxmpp/tls_nb.py
@@ -407,7 +407,7 @@ class NonBlockingTLS(PlugIn):
conn = tcpsock._owner._caller
log.debug('Using client cert and key from %s' % conn.client_cert)
try:
- p12 = OpenSSL.crypto.load_pkcs12(open(conn.client_cert).read(),
+ p12 = OpenSSL.crypto.load_pkcs12(open(conn.client_cert, 'rb').read(),
conn.client_cert_passphrase)
except OpenSSL.crypto.Error as exception_obj:
log.warning('Unable to load client pkcs12 certificate from '
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/f005d610c74ea0102b04ad5972…
---
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/f005d610c74ea0102b04ad5972…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
f8ddefb6 by Philipp Hörist at 2017-12-10T22:56:20+01:00
Fix var reference
- - - - -
1 changed file:
- gajim/common/connection.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -283,7 +283,7 @@ class CommonConnection:
self.check_jid(obj.jid)
except helpers.InvalidFormat:
app.nec.push_incoming_event(InformationEvent(
- None, dialog_name='invalid-jid', args=jid))
+ None, dialog_name='invalid-jid', args=obj.jid))
return
if obj.message and not obj.xhtml and app.config.get(
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f8ddefb6da01d3695fc04463adf26c9ea4…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f8ddefb6da01d3695fc04463adf26c9ea4…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
be32d9af by André Apitzsch at 2017-12-09T00:34:47+01:00
Remove upower_listener
the 'Sleeping' signal has been removed from UPower about four years ago
https://cgit.freedesktop.org/upower/commit/src/org.freedesktop.UPower.xml?i…
- - - - -
4cccdad5 by Philipp Hörist at 2017-12-09T11:43:28+01:00
Merge branch 'removeUpower' into 'master'
Remove upower_listener
See merge request gajim/gajim!166
- - - - -
3 changed files:
- gajim/features_window.py
- gajim/gui_interface.py
- − gajim/upower_listener.py
Changes:
=====================================
gajim/features_window.py
=====================================
--- a/gajim/features_window.py
+++ b/gajim/features_window.py
@@ -85,10 +85,6 @@ class FeaturesWindow:
_('Ability to request your router to forward port for file transfer.'),
_('Requires gir1.2-gupnpigd-1.0.'),
_('Feature not available under Windows.')),
- _('UPower'): (self.upower_available,
- _('Ability to disconnect properly just before suspending the machine.'),
- _('Requires upower and python-dbus.'),
- _('Feature not available under Windows.')),
}
# name, supported
@@ -186,8 +182,3 @@ class FeaturesWindow:
def gupnp_igd_available(self):
return app.HAVE_UPNP_IGD
- def upower_available(self):
- if os.name == 'nt':
- return False
- from gajim import upower_listener
- return upower_listener.supported
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2853,7 +2853,6 @@ class Interface:
self.remote_ctrl = None
if dbus_support.supported:
- from gajim import upower_listener
from gajim import logind_listener
# Handle gnome screensaver
=====================================
gajim/upower_listener.py deleted
=====================================
--- a/gajim/upower_listener.py
+++ /dev/null
@@ -1,47 +0,0 @@
-## src/upower_listener.py
-##
-## Copyright (C) 2006-2014 Yann Leboulanger <asterix AT lagaule.org>
-##
-## 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/>.
-##
-
-
-supported = False
-
-from gajim.common import dbus_support
-from gajim.common import app
-
-def on_suspend(*args, **kwargs):
- for name, conn in app.connections.items():
- if app.account_is_connected(name):
- conn.old_show = app.SHOW_LIST[conn.connected]
- st = conn.status
- conn.change_status('offline', _('Machine going to sleep'))
- conn.status = st
- conn.time_to_reconnect = 5
-
-if dbus_support.supported:
- try:
- from gajim.common.dbus_support import system_bus
- bus = system_bus.bus()
- if 'org.freedesktop.UPower' in bus.list_names():
- up_object = bus.get_object('org.freedesktop.UPower',
- '/org/freedesktop/UPower')
- bus.add_signal_receiver(on_suspend, 'Sleeping',
- 'org.freedesktop.UPower', 'org.freedesktop.UPower',
- '/org/freedesktop/UPower')
- supported = True
- except Exception:
- pass
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/786ef9640094cd0f8e77ec34a9ce59646…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/786ef9640094cd0f8e77ec34a9ce59646…
You're receiving this email because of your account on dev.gajim.org.