core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
This commit is contained in:
parent
2a40da1664
commit
005ec59a8a
1 changed files with 123 additions and 101 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue