core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'

This commit is contained in:
Goffi 2014-03-21 16:27:09 +01:00
commit 005ec59a8a

View file

@ -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 @@ class XEP_0054(object):
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 @@ class XEP_0054(object):
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.