diff src/core/xmpp.py @ 538:2c4016921403

core, frontends, bridgen plugins: fixed methods which were unproperly managing multi-profiles - added profile argument to askConfirmation, actionResult, actionResultExt, entityDataUpdated, confirmationAnswer, getProgress - core, frontends: fixed calls/signals according to new bridge API - user of proper profile namespace for progression indicators and dialogs - memory: getParam* now return bool when param type is bool - memory: added getStringParam* to return string instead of typed value - core, memory, storage, quick_frontend: getHistory now manage properly multi-profiles - plugins XEP-0047, XEP-0054, XEP-0065, XEP-0077, XEP-0096; multi-profiles proper handling
author Goffi <goffi@goffi.org>
date Sat, 10 Nov 2012 16:38:16 +0100
parents 9a3913fb0a6c
children 2c5ef983f2ef
line wrap: on
line diff
--- a/src/core/xmpp.py	Sun Nov 04 23:53:26 2012 +0100
+++ b/src/core/xmpp.py	Sat Nov 10 16:38:16 2012 +0100
@@ -37,6 +37,9 @@
         self.host_app = host_app
         self.client_initialized = defer.Deferred()
         self.conn_deferred = defer.Deferred()
+        self._waiting_conf = {}  #callback called when a confirmation is received
+        self._progress_cb_map = {}  #callback called when a progress is requested (key = progress id)
+        
 
     def getConnectionDeferred(self):
         """Return a deferred which fire when the client is connected"""
@@ -360,7 +363,7 @@
 
 class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
 
-    def __init__(self, host, jabber_host, user_login, user_pass, email, answer_id):
+    def __init__(self, host, jabber_host, user_login, user_pass, email, answer_id, profile):
         xmlstream.ConnectAuthenticator.__init__(self, jabber_host)
         self.host = host
         self.jabber_host = jabber_host
@@ -368,6 +371,7 @@
         self.user_pass = user_pass
         self.user_email = email
         self.answer_id = answer_id
+        self.profile = profile
         print _("Registration asked for"),user_login, user_pass, jabber_host
     
     def connectionMade(self):
@@ -392,7 +396,7 @@
         debug (_("registration answer: %s") % answer.toXml())
         answer_type = "SUCCESS"
         answer_data={"message":_("Registration successfull")}
-        self.host.bridge.actionResult(answer_type, self.answer_id, answer_data)
+        self.host.bridge.actionResult(answer_type, self.answer_id, answer_data, self.profile)
         self.xmlstream.sendFooter()
         
     def registrationFailure(self, failure):
@@ -405,7 +409,7 @@
         else:
             answer_data['reason'] = 'unknown'
             answer_data={"message":_("Registration failed (%s)") % str(failure.value.condition)}
-        self.host.bridge.actionResult(answer_type, self.answer_id, answer_data)
+        self.host.bridge.actionResult(answer_type, self.answer_id, answer_data, self.profile)
         self.xmlstream.sendFooter()
 
 class SatVersionHandler(generic.VersionHandler):