diff frontends/src/jp/jp @ 542:3eeb6c865e4d

frontends: incoming files transfer management: - quick app: getWaitingConf is used on profile connexion - primitivus: askConfirmation is now managed, use new 'dir' style of FileDialog
author Goffi <goffi@goffi.org>
date Wed, 14 Nov 2012 20:37:15 +0100
parents 2c4016921403
children ca13633d3b6b
line wrap: on
line diff
--- a/frontends/src/jp/jp	Wed Nov 14 20:24:28 2012 +0100
+++ b/frontends/src/jp/jp	Wed Nov 14 20:37:15 2012 +0100
@@ -282,13 +282,13 @@
         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 @@
             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 @@
 
     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: