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 logging import debug, info, warning, error
from twisted.words.xish import domish
from twisted.internet import protocol, defer
@ -82,7 +83,7 @@ class XEP_0249(object):
def getHandler(self, profile):
return XEP_0249_handler(self)
def invite(self, target, room, options={}, profile_key='@DEFAULT@'):
def invite(self, target, room, options={}, profile_key=C.PROF_KEY_NONE):
"""
Invite a user to a room
@param target: jid of the user to invite
@ -102,7 +103,7 @@ class XEP_0249(object):
x_elt[opt] = options[opt]
self.host.profiles[profile].xmlstream.send(message)
def _invite(self, target, service, roomId, options={}, profile_key='@DEFAULT@'):
def _invite(self, target, service, roomId, options={}, profile_key=C.PROF_KEY_NONE):
"""
Invite an user to a room
@param target: jid of the user to invite
@ -113,7 +114,7 @@ class XEP_0249(object):
#TODO: check parameters validity
self.invite(jid.JID(target), jid.JID("%s@%s" % (roomId, service)), options, profile_key)
def _accept(self, room, profile_key='@DEFAULT@'):
def _accept(self, room, profile_key=C.PROF_KEY_NONE):
"""
Accept the invitation to join a MUC
@param room: room jid as string