changeset ac7c628635eb in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=ac7c628635eb
description: dont cancel when we cant bind to port. Fixes #7173
diffstat:
src/common/socks5.py | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diffs (34 lines):
diff -r e2ec1b037b4d -r ac7c628635eb src/common/socks5.py
--- a/src/common/socks5.py Wed May 30 08:30:49 2012 +0200
+++ b/src/common/socks5.py Fri Jun 08 20:02:45 2012 -0400
@@ -22,7 +22,6 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
-
import socket
import struct
import hashlib
@@ -98,13 +97,6 @@
fingerprint=fingerprint)
self.listener.queue = self
self.listener.bind()
- if self.listener.started is False:
- self.listener = None
- # We cannot bind port, call error callback and fail
- self.error_cb(_('Unable to bind to port %s.') % port,
- _('Maybe you have another running instance of Gajim. File '
- 'Transfer will be cancelled.'))
- return None
else:
# There is already a listener, we update the file's information
# on the new connection.
@@ -1473,7 +1465,7 @@
self.ai = None
continue
if not self.ai:
- # unable to bind, show error dialog
+ log.error('unable to bind to port ' + str(self.port))
return None
self._serv.listen(socket.SOMAXCONN)
self._serv.setblocking(False)
changeset cac4252df282 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=cac4252df282
description: send hash in session-init when the file is less than 10 mb
diffstat:
src/common/connection_handlers_events.py | 4 ++++
src/common/jingle_content.py | 7 ++++++-
src/common/jingle_ft.py | 30 ++++++++++++++++++++----------
src/common/jingle_session.py | 19 +++++++++----------
4 files changed, 39 insertions(+), 21 deletions(-)
diffs (118 lines):
diff -r c157e198bae5 -r cac4252df282 src/common/connection_handlers_events.py
--- a/src/common/connection_handlers_events.py Mon May 28 18:07:52 2012 -0400
+++ b/src/common/connection_handlers_events.py Mon May 28 19:54:59 2012 -0400
@@ -1980,6 +1980,10 @@
if val is None:
continue
self.file_props[name] = val
+ # Delete this, it shouldn't be necesary after file_props gets
+ # refactored.
+ if name == 'hash':
+ self.file_props['algo'] = child.getAttr('algo')
file_desc_tag = file_tag.getTag('desc')
if file_desc_tag is not None:
self.file_props['desc'] = file_desc_tag.getData()
diff -r c157e198bae5 -r cac4252df282 src/common/jingle_content.py
--- a/src/common/jingle_content.py Mon May 28 18:07:52 2012 -0400
+++ b/src/common/jingle_content.py Mon May 28 19:54:59 2012 -0400
@@ -162,7 +162,7 @@
self.sent = True
content.addChild(node=self.transport.make_transport())
- def _fill_content(self, content, action):
+ def _fill_content(self, content):
description_node = xmpp.simplexml.Node(
tag=xmpp.NS_JINGLE_FILE_TRANSFER + ' description')
@@ -183,6 +183,11 @@
if 'hash' in self.file_props:
# TODO: use xep-300 for this bit
pass
+ # if the file is less than 10 mb, then it is small
+ # lets calculate it right away
+ if int(self.file_props['size']) < 10000000:
+ h = self._calcHash()
+ file_tag.addChild(node=h)
desc = file_tag.setTag('desc')
if 'desc' in self.file_props:
desc.setData(self.file_props['desc'])
diff -r c157e198bae5 -r cac4252df282 src/common/jingle_ft.py
--- a/src/common/jingle_ft.py Mon May 28 18:07:52 2012 -0400
+++ b/src/common/jingle_ft.py Mon May 28 19:54:59 2012 -0400
@@ -117,12 +117,27 @@
gajim.nec.push_incoming_event(FileRequestReceivedEvent(None,
conn=self.session.connection, stanza=stanza, jingle_content=content,
FT_content=self))
+ # Delete this after file_props refactoring this shouldn't be necesary
+ self.session.file_hash = self.file_props['hash']
+ self.session.hash_algo = self.file_props['algo']
def __on_session_initiate_sent(self, stanza, content, error, action):
# Calculate file_hash in a new thread
- self.hashThread = threading.Thread(target=self.__calcHash)
- self.hashThread.start()
+ # if we haven't sent the hash already.
+ if 'hash' not in self.file_props:
+ self.hashThread = threading.Thread(target=self.__send_hash)
+ self.hashThread.start()
- def __calcHash(self):
+ def __send_hash(self):
+ # Send hash in a session info
+ checksum = xmpp.Node(tag='checksum',
+ payload=[xmpp.Node(tag='file',
+ payload=[self._calcHash()])])
+ checksum.setNamespace(xmpp.NS_JINGLE_FILE_TRANSFER)
+ self.session.__session_info(checksum )
+
+
+ def _calcHash(self):
+ # Caculates the hash and returns a xep-300 hash stanza
if self.session.hash_algo == None:
return
try:
@@ -139,13 +154,8 @@
return
self.file_props['hash'] = hash_
h.addHash(hash_, self.session.hash_algo)
- checksum = xmpp.Node(tag='checksum',
- payload=[xmpp.Node(tag='file', payload=[h])])
- checksum.setNamespace(xmpp.NS_JINGLE_FILE_TRANSFER)
- # Send hash in a session info
- self.session.__session_info(checksum )
-
-
+ return h
+
def __on_session_accept(self, stanza, content, error, action):
log.info("__on_session_accept")
con = self.session.connection
diff -r c157e198bae5 -r cac4252df282 src/common/jingle_session.py
--- a/src/common/jingle_session.py Mon May 28 18:07:52 2012 -0400
+++ b/src/common/jingle_session.py Mon May 28 19:54:59 2012 -0400
@@ -433,17 +433,16 @@
payload = jingle.getPayload()
for p in payload:
if p.getName() == 'checksum':
- hashes = p.getTag('file').getTag(name='hashes',
+ hash_ = p.getTag('file').getTag(name='hash',
namespace=xmpp.NS_HASHES)
- for hash in hashes.getChildren():
- algo = hash.getAttr('algo')
- if algo in xmpp.Hashes.supported:
- self.hash_algo = algo
- data = hash.getData()
- # This only works because there is only one session
- # per file in jingleFT
- self.file_hash = data
- raise xmpp.NodeProcessed
+ algo = hash_.getAttr('algo')
+ if algo in xmpp.Hashes.supported:
+ self.hash_algo = algo
+ data = hash_.getData()
+ # This only works because there is only one session
+ # per file in jingleFT
+ self.file_hash = data
+ raise xmpp.NodeProcessed
self.__send_error(stanza, 'feature-not-implemented', 'unsupported-info', type_='modify')
raise xmpp.NodeProcessed
changeset ec78ce7188b4 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=ec78ce7188b4
description: redraw partipiant list after maximizing the conference. Fixes #6961
diffstat:
src/roster_window.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (22 lines):
diff -r 1a3dc2a7f03d -r ec78ce7188b4 src/roster_window.py
--- a/src/roster_window.py Wed May 09 12:16:48 2012 +0400
+++ b/src/roster_window.py Sat May 12 21:51:05 2012 +0400
@@ -3390,6 +3390,9 @@
mw.window.window.focus(gtk.get_current_event_time())
return
ctrl = gajim.interface.minimized_controls[account][jid]
+ # redrawing partipiant list
+ sw = ctrl.xml.get_object('list_scrolledwindow')
+ sw.queue_draw()
mw = gajim.interface.msg_win_mgr.get_window(jid, account)
if not mw:
mw = gajim.interface.msg_win_mgr.create_window(ctrl.contact,
@@ -6409,7 +6412,7 @@
# it means we are waiting for this number of accounts to disconnect
# before quitting
self.quit_on_next_offline = -1
-
+
# groups to draw next time we draw groups.
self.groups_to_draw = {}
# accounts to draw next time we draw accounts.