fix sending result iq in IBB

This commit is contained in:
Yann Leboulanger 2012-01-08 20:29:24 +01:00
parent 5017c7e17c
commit 61a039d894
1 changed files with 9 additions and 4 deletions

View File

@ -781,8 +781,8 @@ class ConnectionIBBytestream(ConnectionBytestream):
self.StreamCloseHandler(conn, stanza) self.StreamCloseHandler(conn, stanza)
elif typ == 'result': elif typ == 'result':
self.SendHandler() self.SendHandler()
elif typ == 'error': # elif typ == 'error':
self.StreamOpenReplyHandler(conn, stanza) # self.StreamOpenReplyHandler(conn, stanza)
else: else:
conn.send(xmpp.Error(stanza, xmpp.ERR_BAD_REQUEST)) conn.send(xmpp.Error(stanza, xmpp.ERR_BAD_REQUEST))
raise xmpp.NodeProcessed raise xmpp.NodeProcessed
@ -957,13 +957,17 @@ class ConnectionIBBytestream(ConnectionBytestream):
log.debug('StreamCloseHandler called sid->%s' % sid) log.debug('StreamCloseHandler called sid->%s' % sid)
# look in sending files # look in sending files
if sid in self.files_props.keys(): if sid in self.files_props.keys():
conn.send(stanza.buildReply('result')) reply = stanza.buildReply('result')
reply.delChild('close')
conn.send(reply)
gajim.socks5queue.complete_transfer_cb(self.name, self.files_props[sid]) gajim.socks5queue.complete_transfer_cb(self.name, self.files_props[sid])
del self.files_props[sid] del self.files_props[sid]
# look in receiving files # look in receiving files
elif gajim.socks5queue.get_file_props(self.name, sid): elif gajim.socks5queue.get_file_props(self.name, sid):
file_props = gajim.socks5queue.get_file_props(self.name, sid) file_props = gajim.socks5queue.get_file_props(self.name, sid)
conn.send(stanza.buildReply('result')) reply = stanza.buildReply('result')
reply.delChild('close')
conn.send(reply)
file_props['fp'].close() file_props['fp'].close()
gajim.socks5queue.complete_transfer_cb(self.name, file_props) gajim.socks5queue.complete_transfer_cb(self.name, file_props)
gajim.socks5queue.remove_file_props(self.name, sid) gajim.socks5queue.remove_file_props(self.name, sid)
@ -1003,6 +1007,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
if stanza.getTag('data'): if stanza.getTag('data'):
if self.IBBMessageHandler(conn, stanza): if self.IBBMessageHandler(conn, stanza):
reply = stanza.buildReply('result') reply = stanza.buildReply('result')
reply.delChild('data')
conn.send(reply) conn.send(reply)
raise xmpp.NodeProcessed raise xmpp.NodeProcessed
elif syn_id == self.last_sent_ibb_id: elif syn_id == self.last_sent_ibb_id: