Yann Leboulanger pushed to branch gajim_0.16 at gajim / gajim
Commits:
d2782622 by Yann Leboulanger at 2017-02-28T22:28:49+01:00
check for errors when adding a transport contact. Fixes #8196
- - - - -
1 changed file:
- src/dialogs.py
Changes:
=====================================
src/dialogs.py
=====================================
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -1249,6 +1249,11 @@ class AddNewContactWindow:
def _nec_gateway_prompt_received(self, obj):
if self.adding_jid:
jid, transport, type_ = self.adding_jid
+ if obj.stanza.getError():
+ ErrorDialog(_('Error while adding transport contact'),
+ _('This error occured while adding a contact for transport '
+ '%s:\n\n%s') % (transport, obj.stanza.getErrorMsg()))
+ return
if obj.prompt_jid:
self._add_jid(obj.prompt_jid, type_)
else:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d2782622952a3cc45dbc87d0e948507316…
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
8a1a326b by Philipp Hörist at 2017-02-25T19:21:21+01:00
Add extension point in plugins window
- - - - -
1 changed file:
- src/plugins/gui.py
Changes:
=====================================
src/plugins/gui.py
=====================================
--- a/src/plugins/gui.py
+++ b/src/plugins/gui.py
@@ -114,10 +114,8 @@ class PluginsWindow(object):
self.plugins_notebook.set_current_page(0)
self.xml.get_object('close_button').grab_focus()
- for plugin in gajim.plugin_manager.active_plugins:
- if type(plugin).__name__ == 'PluginInstaller':
- plugin.on_activate(self)
- break
+ # Adding GUI extension point for Plugins that want to hook the Plugin Window
+ gajim.plugin_manager.gui_extension_point('plugin_window', self)
self.window.show_all()
gtkgui_helpers.possibly_move_window_in_current_desktop(self.window)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/8a1a326bae3f04d6824f4915f4ba85b3f5…
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
279ec6b8 by Thilo Molitor at 2017-02-13T23:11:54+01:00
Fix smacks delayed tag addition.
Only add delayed tag to stanzas saved into smacks queue, not to the ones
send out directly.
- - - - -
027b7a30 by Thilo Molitor at 2017-02-13T23:11:54+01:00
Fix bug in failed smacks resumption
Extract correct h value when session resumption failed.
Add some more logging output.
- - - - -
ed4a9e05 by Philipp Hörist at 2017-02-13T23:15:43+01:00
Merge branch 'smacks_rev_1.5' into 'master'
Fix smacks delayed tag addition.
See merge request !3
- - - - -
2 changed files:
- nbxmpp/dispatcher_nb.py
- nbxmpp/smacks.py
Changes:
=====================================
nbxmpp/dispatcher_nb.py
=====================================
--- a/nbxmpp/dispatcher_nb.py
+++ b/nbxmpp/dispatcher_nb.py
@@ -27,6 +27,7 @@ import time
import locale
import re
import uuid
+import copy
from xml.parsers.expat import ExpatError
from .plugin import PlugIn
from .protocol import (NS_DELAY2, NS_STREAMS, NS_XMPP_STREAMS, NS_HTTP_BIND, Iq, Presence,
@@ -572,14 +573,15 @@ class XMPPDispatcher(PlugIn):
# If no ID then it is a whitespace
if self.sm and self.sm.enabled and ID:
+ stanza_copy = copy.deepcopy(stanza)
# add timestamp to message stanza in queue
- if stanza.getName() == 'message' and \
- (stanza.getType() == 'chat' or stanza.getType() == 'groupchat'):
- our_jid = stanza.getAttr('from')
+ if stanza_copy.getName() == 'message' and \
+ (stanza_copy.getType() == 'chat' or stanza_copy.getType() == 'groupchat'):
+ our_jid = stanza_copy.getAttr('from')
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(None))
- stanza.addChild('delay', namespace=NS_DELAY2,
- attrs={'from': our_jid, 'stamp': timestamp})
- self.sm.uqueue.append(stanza)
+ stanza_copy.addChild('delay', namespace=NS_DELAY2,
+ attrs={'from': our_jid or "Gajim", 'stamp': timestamp})
+ self.sm.uqueue.append(stanza_copy)
self.sm.out_h += 1
self._owner.Connection.send(stanza, now)
=====================================
nbxmpp/smacks.py
=====================================
--- a/nbxmpp/smacks.py
+++ b/nbxmpp/smacks.py
@@ -124,13 +124,13 @@ class Smacks(object):
diff = self.out_h - h
if diff < 0:
- log.error('Server and client number of stanzas handled mismatch (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch (our h: %d, server h: %d, #queue: %d)' % (self.out_h, h, len(self.uqueue)))
while (len(self.uqueue)): #don't accumulate all messages in this case (they would otherwise all be resent on the next reconnect)
self.uqueue.pop(0)
elif len(self.uqueue) < diff:
- log.error('Server and client number of stanzas handled mismatch (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch (our h: %d, server h: %d, #queue: %d)' % (self.out_h, h, len(self.uqueue)))
else:
- log.debug('Got ack for outgoing stanzas (our h: %d, server h: %d), removing %d messages from queue...' % (self.out_h, h, len(self.uqueue) - diff))
+ log.debug('Got ack for outgoing stanzas (our h: %d, server h: %d, #queue: %d), removing %d messages from queue...' % (self.out_h, h, len(self.uqueue), len(self.uqueue) - diff))
while (len(self.uqueue) > diff):
self.uqueue.pop(0)
@@ -149,12 +149,12 @@ class Smacks(object):
diff = self.out_h - h
if diff < 0:
- log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d. #queue: %d)' % (self.out_h, h, len(self.old_uqueue)))
self.old_uqueue = [] #that's weird, but we don't resend this stanzas if the server says we don't need to
elif len(self.old_uqueue) < diff:
- log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d, #queue: %d)' % (self.out_h, h, len(self.old_uqueue)))
else:
- log.info('Removing %d already acked stanzas from old outgoing queue (our h: %d, server h: %d, remaining in queue: %d)' % (len(self.old_uqueue) - diff, self.out_h, h, diff))
+ log.info('Removing %d already acked stanzas from old outgoing queue (our h: %d, server h: %d, #queue: %d, remaining in queue: %d)' % (len(self.old_uqueue) - diff, self.out_h, h, len(self.old_uqueue), diff))
while (len(self.old_uqueue) > diff):
self.old_uqueue.pop(0)
@@ -178,7 +178,7 @@ class Smacks(object):
self._owner._on_auth_bind(None)
self.failed_resume = True
- h = stanza.getTag('item-not-found').getAttr('h')
+ h = stanza.getAttr('h')
log.info('Session resumption failed (item-not-found), server h: %s' % str(h))
if not h:
return
@@ -187,12 +187,12 @@ class Smacks(object):
diff = self.out_h - h
if diff < 0:
- log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d, #queue: %d)' % (self.out_h, h, len(self.old_uqueue)))
self.old_uqueue = [] #that's weird, but we don't resend this stanzas if the server says we don't need to
elif len(self.old_uqueue) < diff:
- log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d)' % (self.out_h, h))
+ log.error('Server and client number of stanzas handled mismatch on session resumption (our h: %d, server h: %d, #queue: %d)' % (self.out_h, h, len(self.old_uqueue)))
else:
- log.info('Removing %d already acked stanzas from old outgoing queue (our h: %d, server h: %d, remaining in queue: %d)' % (len(self.old_uqueue) - diff, self.out_h, h, diff))
+ log.info('Removing %d already acked stanzas from old outgoing queue (our h: %d, server h: %d, #queue: %d, remaining in queue: %d)' % (len(self.old_uqueue) - diff, self.out_h, h, len(self.old_uqueue), diff))
while (len(self.old_uqueue) > diff):
self.old_uqueue.pop(0)
return
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/8f1c3b113c75f1f81fcdd8807…
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
171bac23 by Philipp Hörist at 2017-02-13T00:18:28+01:00
Save own full jid
- - - - -
8f1c3b11 by Philipp Hörist at 2017-02-13T22:45:15+01:00
Merge branch 'master' into 'master'
Save own full jid
See merge request !4
- - - - -
1 changed file:
- nbxmpp/auth_nb.py
Changes:
=====================================
nbxmpp/auth_nb.py
=====================================
--- a/nbxmpp/auth_nb.py
+++ b/nbxmpp/auth_nb.py
@@ -731,6 +731,7 @@ class NonBlockingBind(PlugIn):
self.bound.append(resp.getTag('bind').getTagData('jid'))
log.info('Successfully bound %s.' % self.bound[-1])
jid = JID(resp.getTag('bind').getTagData('jid'))
+ self._owner._registered_name = jid
self._owner.User = jid.getNode()
self._owner.Resource = jid.getResource()
# Only negociate stream management after bounded
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/5c2c0b22f09c8bc541046f91f…