diff src/core/constants.py @ 1459:4c4f88d7b156

plugins xep-0060, xep-0163, xep-0277, groupblog: bloging improvments (huge patch, sorry): /!\ not everything is working yet, and specially groupblogs are broken /!\ - renamed bridge api to use prefixed methods (e.g. psSubscribeToMany instead of subscribeToMany in PubSub) - (xep-0060): try to find a default PubSub service, and put it in client.pubsub_service - (xep-0060): extra dictionary can be used in bridge method for RSM and other options - (xep-0060): XEP_0060.addManagedNode and XEP_0060.removeManagedNode allow to easily catch notifications for a specific node - (xep-0060): retractItem manage "notify" attribute - (xep-0060): new signal psEvent will be used to transmit notifications to frontends - (xep-0060, constants): added a bunch of useful constants - (xep-0163): removed personalEvent in favor of psEvent - (xep-0163): addPEPEvent now filter non PEP events for in_callback - (xep-0277): use of new XEP-0060 plugin's addManagedNode - (xep-0277): fixed author handling for incoming blogs: author is the human readable name, author_jid it jid, and author_jid_verified is set to True is the jid is checked - (xep-0277): reworked data2entry with Twisted instead of feed, item_id can now be specified, <content/> is changed to <title/> if there is only content - (xep-0277): comments are now managed here (core removed from groupblog) - (xep-0277): (comments) node is created if needed, default pubsub service is used if available, else PEP - (xep-0277): retract is managed
author Goffi <goffi@goffi.org>
date Sun, 16 Aug 2015 00:39:44 +0200
parents 4e2fab4de195
children 9667103a0c10
line wrap: on
line diff
--- a/src/core/constants.py	Sun Aug 16 00:06:59 2015 +0200
+++ b/src/core/constants.py	Sun Aug 16 00:39:44 2015 +0200
@@ -82,7 +82,8 @@
     ENTITY_CAP_HASH = 'CAP_HASH'
 
     ## Roster jids selection ##
-    ALL = 'ALL'
+    PUBLIC = 'PUBLIC'
+    ALL = 'ALL' # ALL means all known contacts, while PUBLIC means everybody, known or not
     GROUP = 'GROUP'
     JID = 'JID'
 
@@ -129,6 +130,18 @@
     # names of widely used plugins
     TEXT_CMDS = 'TEXT-COMMANDS'
 
+    # PubSub event categories
+    PS_PEP = "PEP"
+    PS_MICROBLOG = "MICROBLOG"
+
+    # PubSub
+    PS_PUBLISH = "publish"
+    PS_RETRACT = "retract" # used for items
+    PS_DELETE = "delete" #used for nodes
+    PS_ITEM = "item"
+    PS_ITEMS = "items" # Can contain publish and retract items
+    PS_EVENTS = (PS_ITEMS, PS_DELETE)
+
 
     ## XMLUI ##
     XMLUI_WINDOW = 'window'
@@ -230,7 +243,7 @@
     def bool(cls, value):
         """@return (bool): bool value for associated constant"""
         assert isinstance(value, basestring)
-        return value.lower() == cls.BOOL_TRUE
+        return value.lower() in (cls.BOOL_TRUE, "1")
 
     @classmethod
     def boolConst(cls, value):