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.protocols.jabber import jid
from twisted.internet import defer
@ -309,7 +310,7 @@ class XEP_0277(object):
ret = yield self.host.plugins["XEP-0060"].publish(None, NS_MICROBLOG, [item], profile_key=profile)
defer.returnValue(ret)
def getLastMicroblogs(self, pub_jid, max_items=10, profile_key='@DEFAULT@'):
def getLastMicroblogs(self, pub_jid, max_items=10, profile_key=C.PROF_KEY_NONE):
"""Get the last published microblogs
@param pub_jid: jid of the publisher
@param max_items: how many microblogs we want to get
@ -329,7 +330,7 @@ class XEP_0277(object):
d.addCallback(resultToArray)
return d
def setMicroblogAccess(self, access="presence", profile_key='@DEFAULT@'):
def setMicroblogAccess(self, access="presence", profile_key=C.PROF_KEY_NONE):
"""Create a microblog node on PEP with given access
If the node already exists, it change options
@param access: Node access model, according to xep-0060 #4.5