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

@ -18,6 +18,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 sat.core import exceptions
from logging import debug, info, warning, error
from twisted.words.protocols.jabber import jid
@ -98,10 +99,10 @@ class XEP_0077(object):
raise exceptions.ConflictError( _("Username already exists, please choose an other one"))
raise failure
def _inBandRegister(self, to_jid_s, profile_key='@NONE@'):
def _inBandRegister(self, to_jid_s, profile_key=C.PROF_KEY_NONE):
return self.inBandRegister, jid.JID(to_jid_s, profile_key)
def inBandRegister(self, to_jid, post_treat_cb=None, profile_key='@NONE@'):
def inBandRegister(self, to_jid, post_treat_cb=None, profile_key=C.PROF_KEY_NONE):
"""register to a target JID"""
client = self.host.getClient(profile_key)
if not client: