diff src/plugins/plugin_xep_0085.py @ 916:1a759096ccbd

core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
author Goffi <goffi@goffi.org>
date Fri, 21 Mar 2014 16:27:09 +0100
parents 2ef523f0b5c3
children c897c8d321b3
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0085.py	Fri Mar 21 16:19:46 2014 +0100
+++ b/src/plugins/plugin_xep_0085.py	Fri Mar 21 16:27:09 2014 +0100
@@ -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 info
 from wokkel import disco, iwokkel
@@ -117,11 +118,11 @@
         Update the entity data of the given profile for one or all contacts.
         Reset the chat state(s) display if the notification has been disabled.
         @param entity_jid: contact's JID, or '@ALL@' to update all contacts.
-        @param value: True, False or '@NONE@' to delete the entity data
+        @param value: True, False or C.PROF_KEY_NONE to delete the entity data
         @param profile: current profile
         """
         self.host.memory.updateEntityData(entity_jid, ENTITY_KEY, value, profile)
-        if not value or value == "@NONE@":
+        if not value or value == C.PROF_KEY_NONE:
             # disable chat state for this or these contact(s)
             self.host.bridge.chatStateReceived(unicode(entity_jid), "", profile)
 
@@ -133,7 +134,7 @@
         @param category: parameter category
         """
         if (category, name) == (PARAM_KEY, PARAM_NAME):
-            self.updateEntityData("@ALL@", True if value == "true" else "@NONE@", profile)
+            self.updateEntityData("@ALL@", True if value == "true" else C.PROF_KEY_NONE, profile)
             return False
         return True