Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
af547a18 by Yann Leboulanger at 2017-08-12T14:40:26+02:00
don't close the socket we're using to tranfer file. Fixes #8657
- - - - -
1 changed file:
- gajim/common/socks5.py
Changes:
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -585,7 +585,7 @@ class Socks5(object):
pass
self.file = None
# Close file we're receiving into
- if self.file_props.fd:
+ if self.file_props.fd and self.state >= 7:
try:
self.file_props.fd.close()
except Exception:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/af547a1827a1fd8e8b408912426e68367c…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/af547a1827a1fd8e8b408912426e68367c…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / python-nbxmpp
Commits:
f4c0ef02 by Yann Leboulanger at 2017-08-12T14:17:51+02:00
improve comparing XML
- - - - -
2 changed files:
- test/lib/__init__.py
- test/unit/test_xmpp_dispatcher_nb.py
Changes:
=====================================
test/lib/__init__.py
=====================================
--- a/test/lib/__init__.py
+++ b/test/lib/__init__.py
@@ -9,12 +9,34 @@ root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../..')
sys.path.insert(1, root)
sys.path.insert(1, root + '/test/lib')
-def sortxml(data):
- sorted(data.attrs.keys())
+def xml2str_sorted(data):
+ s = "<" + data.name
+ if data.namespace:
+ if not data.parent or data.parent.namespace!=data.namespace:
+ if 'xmlns' not in data.attrs:
+ s += ' xmlns="%s"' % data.namespace
+ for key in sorted(data.attrs.keys()):
+ val = str(data.attrs[key])
+ s += ' %s="%s"' % (key, val)
+
+ s += ">"
+ cnt = 0
if data.kids:
for a in data.kids:
- if not isinstance(a, str):
- sortxml(a)
+ if (len(data.data)-1) >= cnt:
+ s += data.data[cnt]
+ if isinstance(a, str):
+ s += a.__str__()
+ else:
+ s += xml2str_sorted(a)
+ cnt += 1
+ if (len(data.data)-1) >= cnt:
+ s += data.data[cnt]
+ if not data.kids and s.endswith('>'):
+ s = s[:-1] + ' />'
+ else:
+ s += "</" + data.name + ">"
+ return s
def setup_env():
pass
=====================================
test/unit/test_xmpp_dispatcher_nb.py
=====================================
--- a/test/unit/test_xmpp_dispatcher_nb.py
+++ b/test/unit/test_xmpp_dispatcher_nb.py
@@ -88,8 +88,7 @@ class TestDispatcherNB(unittest.TestCase):
self._simulate_connect()
stanza = "<iq type='get' />"
def send(data):
- lib.sortxml(data)
- self.assertEqual(str(data), '<iq xmlns="jabber:client" type="error"><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">The feature requested is not implemented by the recipient or server and therefore cannot be processed.</text></error></iq>')
+ self.assertEqual(lib.xml2str_sorted(data), '<iq xmlns="jabber:client" type="error"><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">The feature requested is not implemented by the recipient or server and therefore cannot be processed.</text></error></iq>')
self.client.send = send
self.dispatcher.ProcessNonBlocking(stanza)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/f4c0ef02eea1091d483aa48622…
---
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/f4c0ef02eea1091d483aa48622…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
9e4d3c75 by Philipp Hörist at 2017-08-10T23:38:08+02:00
Make method static
Or we would need to pass `self` as an argument
- - - - -
1 changed file:
- src/common/connection_handlers_events.py
Changes:
=====================================
src/common/connection_handlers_events.py
=====================================
--- a/src/common/connection_handlers_events.py
+++ b/src/common/connection_handlers_events.py
@@ -2537,6 +2537,7 @@ class NotificationEvent(nec.NetworkIncomingEvent):
self.do_popup = False
+ @staticmethod
def get_path_to_generic_or_avatar(generic, jid=None, suffix=None):
"""
Choose between avatar image and default image
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9e4d3c75156f2a88052d20b366ac525202…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9e4d3c75156f2a88052d20b366ac525202…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch gajim_0.16 at gajim / gajim
Commits:
2ce5012b by Yann Leboulanger at 2017-08-10T22:05:31+02:00
don't show audio error when it's not an audio error. Fixes #8614
- - - - -
7c84d52c by Yann Leboulanger at 2017-08-10T22:05:31+02:00
don't close the socket we're using to tranfer file. Fixes #8657
- - - - -
2 changed files:
- src/common/socks5.py
- src/gui_interface.py
Changes:
=====================================
src/common/socks5.py
=====================================
--- a/src/common/socks5.py
+++ b/src/common/socks5.py
@@ -597,7 +597,8 @@ class Socks5(object):
pass
self.file = None
# Close file we're receiving into
- if self.file_props.fd:
+ if self.file_props.fd and self.state >= 7:
+ # file opened and it's the Sock we're using to transfer
try:
self.file_props.fd.close()
except Exception:
=====================================
src/gui_interface.py
=====================================
--- a/src/gui_interface.py
+++ b/src/gui_interface.py
@@ -1330,7 +1330,7 @@ class Interface:
account = obj.conn.name
ctrl = (self.msg_win_mgr.get_control(obj.fjid, account)
or self.msg_win_mgr.get_control(obj.jid, account))
- if ctrl:
+ if ctrl and obj.sid == ctrl.audio_sid:
ctrl.set_audio_state('error', reason=obj.reason)
def handle_event_roster_item_exchange(self, obj):
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c19bad88b557cc4ad1e8ef1dfa656252f…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c19bad88b557cc4ad1e8ef1dfa656252f…
You're receiving this email because of your account on dev.gajim.org.