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:
6926bdae by Philipp Hörist at 2017-12-08T20:20:07+01:00
Port some error messages to new interface
- - - - -
7 changed files:
- gajim/accounts_window.py
- gajim/adhoc_commands.py
- gajim/app_actions.py
- gajim/chat_control_base.py
- gajim/dataforms_widget.py
- gajim/dialog_messages.py
- gajim/dialogs.py
Changes:
=====================================
gajim/accounts_window.py
=====================================
--- a/gajim/accounts_window.py
+++ b/gajim/accounts_window.py
@@ -177,10 +177,7 @@ class AccountsWindow(Gtk.ApplicationWindow):
def on_remove_account(self, button, account):
if app.events.get_events(account):
- dialogs.ErrorDialog(
- _('Unread events'),
- _('Read all pending events before removing this account.'),
- transient_for=self)
+ app.interface.raise_dialog('unread-events-on-remove')
return
if app.config.get_per('accounts', account, 'is_zeroconf'):
@@ -361,10 +358,7 @@ class Account(Gtk.Box):
if (account in app.connections and
app.connections[account].connected > 0):
# connecting or connected
- dialogs.ErrorDialog(
- _('You are currently connected to the server'),
- _('To disable the account, you must be disconnected.'),
- transient_for=self.parent)
+ app.interface.raise_dialog('connected-on-disable-account')
switch.set_active(not state)
return
if state:
=====================================
gajim/adhoc_commands.py
=====================================
--- a/gajim/adhoc_commands.py
+++ b/gajim/adhoc_commands.py
@@ -364,10 +364,8 @@ class CommandWindow:
if self.data_form_widget.get_data_form():
df = self.data_form_widget.get_data_form()
if not df.is_valid():
- dialogs.ErrorDialog(
- _('Invalid Form'),
- _('The form is not filled correctly.'),
- transient_for=self.window)
+ app.interface.raise_dialog(
+ 'invalid-form', transient_for=self.window)
self.data_form_widget.set_sensitive(True)
return
self.data_form_widget.data_form.type_ = 'submit'
=====================================
gajim/app_actions.py
=====================================
--- a/gajim/app_actions.py
+++ b/gajim/app_actions.py
@@ -124,8 +124,7 @@ class AppActions():
account = param.get_string()
invisible_show = app.SHOW_LIST.index('invisible')
if app.connections[account].connected == invisible_show:
- dialogs.ErrorDialog(_(
- 'You cannot join a group chat while you are invisible'))
+ app.interface.raise_dialog('join-while-invisible')
return
if 'join_gc' in interface.instances[account]:
interface.instances[account]['join_gc'].present()
=====================================
gajim/chat_control_base.py
=====================================
--- a/gajim/chat_control_base.py
+++ b/gajim/chat_control_base.py
@@ -694,8 +694,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
if send_message and app.connections[self.account].connected < 2:
# we are not connected
- dialogs.ErrorDialog(_('A connection is not available'),
- _('Your message can not be sent until you are connected.'))
+ app.interface.raise_dialog('not-connected-while-sending')
elif send_message:
self.send_message(message, xhtml=xhtml)
else:
=====================================
gajim/dataforms_widget.py
=====================================
--- a/gajim/dataforms_widget.py
+++ b/gajim/dataforms_widget.py
@@ -37,6 +37,7 @@ from gajim import dialogs
from gajim.common import dataforms
from gajim.common import helpers
+from gajim.common import app
import itertools
@@ -641,12 +642,10 @@ class SingleForm(Gtk.Table, object):
try:
newtext = helpers.parse_jid(newtext)
except helpers.InvalidFormat as s:
- dialogs.ErrorDialog(_('Invalid JID'), str(s))
+ app.interface.raise_dialog('invalid-jid-with-error', str(s))
return
if newtext in field.values:
- dialogs.ErrorDialog(
- _('JID already in list'),
- _('The JID you entered is already in the list. Choose another one.'))
+ app.interface.raise_dialog('jid-in-list')
GLib.idle_add(treeview.set_cursor, path)
return
model[path][0]=newtext
=====================================
gajim/dialog_messages.py
=====================================
--- a/gajim/dialog_messages.py
+++ b/gajim/dialog_messages.py
@@ -22,10 +22,52 @@ from collections import namedtuple
from gi.repository import GLib
from gajim.common.app import app
+from gajim.dialogs import ErrorDialog
Message = namedtuple('Message', ['title', 'text', 'dialog'])
-messages = {}
+messages = {
+ 'start-chat-not-connected': Message(
+ _('You are not connected to the server'),
+ _('You can not start a new conversation unless you are connected.'),
+ ErrorDialog),
+
+ 'invalid-jid-with-error': Message(
+ _('Invalid JID'),
+ '%s',
+ ErrorDialog),
+
+ 'unread-events-on-remove-account': Message(
+ _('Unread events'),
+ _('Read all pending events before removing this account.'),
+ ErrorDialog),
+
+ 'connected-on-disable-account': Message(
+ _('You are currently connected to the server'),
+ _('To disable the account, you must be disconnected.'),
+ ErrorDialog),
+
+ 'invalid-form': Message(
+ _('Invalid Form'),
+ _('The form is not filled correctly.'),
+ ErrorDialog),
+
+ 'join-while-invisible': Message(
+ _('Invisible'),
+ _('You cannot join a group chat while you are invisible'),
+ ErrorDialog),
+
+ 'not-connected-while-sending': Message(
+ _('A connection is not available'),
+ _('Your message can not be sent until you are connected.'),
+ ErrorDialog),
+
+ 'jid-in-list': Message(
+ _('JID already in list'),
+ _('The JID you entered is already in the list. Choose another one.'),
+ ErrorDialog),
+
+ }
def get_dialog(name, *args, **kwargs):
@@ -42,8 +84,10 @@ def get_dialog(name, *args, **kwargs):
if args:
message_text = message.text % args
- else:
+ elif kwargs:
message_text = message.text % kwargs
+ else:
+ message_text = message.text
dialog = message.dialog(message.title,
GLib.markup_escape_text(message_text),
transient_for=transient_for)
=====================================
gajim/dialogs.py
=====================================
--- a/gajim/dialogs.py
+++ b/gajim/dialogs.py
@@ -2879,16 +2879,12 @@ class StartChatDialog(Gtk.ApplicationWindow):
def _start_new_chat(self, row):
if row.new:
if not app.account_is_connected(row.account):
- ErrorDialog(
- _('You are not connected to the server'),
- _('You can not start a new conversation'
- ' unless you are connected.'),
- transient_for=self)
+ app.interface.raise_dialog('start-chat-not-connected')
return
try:
helpers.parse_jid(row.jid)
except helpers.InvalidFormat as e:
- ErrorDialog(_('Invalid JID'), str(e), transient_for=self)
+ app.interface.raise_dialog('invalid-jid-with-error', str(e))
return
if row.groupchat:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6926bdaee0234191b3d9610ba4d74434fa…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6926bdaee0234191b3d9610ba4d74434fa…
You're receiving this email because of your account on dev.gajim.org.