frontends: incoming files transfer management:

- quick app: getWaitingConf is used on profile connexion
    - primitivus: askConfirmation is now managed, use new 'dir' style of FileDialog
This commit is contained in:
Goffi 2012-11-14 20:37:15 +01:00
commit 297b439369

View file

@ -282,13 +282,13 @@ class JP():
return param_jid
def askConfirmation(self, type, confirm_id, data, profile):
def askConfirmation(self, confirm_id, confirm_type, data, profile):
"""CB used for file transfer, accept files depending on parameters"""
if profile != self.profile:
debug("Ask confirmation ignored: not our profile")
return
answer_data={}
if type == "FILE_TRANSFER":
if confirm_type == "FILE_TRANSFER":
if not self.options.wait_file:
return
if self.dest_jids and not JID(data['from']).short in [JID(_jid).short for _jid in self.dest_jids]:
@ -308,7 +308,7 @@ class JP():
if not self.options.multiple and not self.options.progress:
#we just accept one file
self.loop.quit()
elif type == "PIPE_TRANSFER":
elif confirm_type == "PIPE_TRANSFER":
if not self.options.pipe_in:
return
if self.dest_jids and not JID(data['from']).short in [JID(_jid).short for _jid in self.dest_jids]:
@ -331,7 +331,12 @@ class JP():
def confirmation_reply(self):
"""Auto reply to confirmations requests"""
#we register incoming confirmation
self.bridge.register("askConfirmation", self.askConfirmation)
#and we ask those we have missed
for confirm_id, confirm_type, data in self.bridge.getWaitingConf(self.profile):
self.askConfirmation(confirm_id, confirm_type, data, self.profile)
def progressCB(self):
if self.transfer_data: