diff src/plugins/plugin_xep_0054.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 65ecbb473cbb
children dcec4ba8e72c
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Sun Nov 04 23:53:26 2012 +0100
+++ b/src/plugins/plugin_xep_0054.py	Sat Nov 10 16:38:16 2012 +0100
@@ -157,15 +157,15 @@
 
         if answer.firstChildElement().name == "vCard":
             d = self.vCard2Dict(answer.firstChildElement(), jid.JID(answer["from"]), profile)
-            d.addCallback(lambda data: self.host.bridge.actionResult("RESULT", answer['id'], data))
+            d.addCallback(lambda data: self.host.bridge.actionResult("RESULT", answer['id'], data, profile))
         else:
             error (_("FIXME: vCard not found as first child element"))
-            self.host.bridge.actionResult("SUPPRESS", answer['id'], {}) #FIXME: maybe an error message would be better
+            self.host.bridge.actionResult("SUPPRESS", answer['id'], {}, profile) #FIXME: maybe an error message would be better
 
-    def vcard_err(self, failure):
+    def vcard_err(self, failure, profile):
         """Called when something is wrong with registration"""
         error (_("Can't find VCard of %s") % failure.value.stanza['from'])
-        self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}) #FIXME: maybe an error message would be better
+        self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) #FIXME: maybe an error message would be better
   
     def getCard(self, target, profile_key='@DEFAULT@'):
         """Ask server for VCard
@@ -182,7 +182,7 @@
         reg_request["from"]=current_jid.full()
         reg_request["to"] = to_jid.userhost()
         reg_request.addElement('vCard', NS_VCARD)
-        reg_request.send(to_jid.userhost()).addCallbacks(self.vcard_ok, self.vcard_err, [profile])
+        reg_request.send(to_jid.userhost()).addCallbacks(self.vcard_ok, self.vcard_err, callbackArgs=[profile], errbackArgs=[profile])
         return reg_request["id"] 
 
     def getAvatarFile(self, hash):