diff src/plugins/plugin_xep_0054.py @ 916:1a759096ccbd

core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
author Goffi <goffi@goffi.org>
date Fri, 21 Mar 2014 16:27:09 +0100
parents 1fe00f0c9a91
children 01342bfe9f41
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Fri Mar 21 16:19:46 2014 +0100
+++ b/src/plugins/plugin_xep_0054.py	Fri Mar 21 16:27:09 2014 +0100
@@ -19,6 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from sat.core.i18n import _
+from sat.core.constants import Const as C
 from logging import debug, info, error
 from twisted.internet import threads
 from twisted.internet.defer import inlineCallbacks, returnValue
@@ -206,7 +207,7 @@
             error(_("Can't find VCard of %s") % failure.value.stanza['from'])
         self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile)  # FIXME: maybe an error message would be better
 
-    def getCard(self, target_s, profile_key='@DEFAULT@'):
+    def getCard(self, target_s, profile_key=C.PROF_KEY_NONE):
         """Ask server for VCard
         @param target_s: jid from which we want the VCard
         @result: id to retrieve the profile"""
@@ -253,7 +254,7 @@
         img_hash = sha1(img_buf.getvalue()).hexdigest()
         return (vcard_set, img_hash)
 
-    def setAvatar(self, filepath, profile_key='@DEFAULT@'):
+    def setAvatar(self, filepath, profile_key=C.PROF_KEY_NONE):
         """Set avatar of the profile
         @param filepath: path of the image of the avatar"""
         #TODO: This is a temporary way of setting avatar, as other VCard informations are not managed.