Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
1458:832846fefe85 | 1459:4c4f88d7b156 |
---|---|
80 ENTITY_ALL_RESOURCES = '@ALL_RESOURCES@' | 80 ENTITY_ALL_RESOURCES = '@ALL_RESOURCES@' |
81 ENTITY_MAIN_RESOURCE = '@MAIN_RESOURCE@' | 81 ENTITY_MAIN_RESOURCE = '@MAIN_RESOURCE@' |
82 ENTITY_CAP_HASH = 'CAP_HASH' | 82 ENTITY_CAP_HASH = 'CAP_HASH' |
83 | 83 |
84 ## Roster jids selection ## | 84 ## Roster jids selection ## |
85 ALL = 'ALL' | 85 PUBLIC = 'PUBLIC' |
86 ALL = 'ALL' # ALL means all known contacts, while PUBLIC means everybody, known or not | |
86 GROUP = 'GROUP' | 87 GROUP = 'GROUP' |
87 JID = 'JID' | 88 JID = 'JID' |
88 | 89 |
89 | 90 |
90 ## Messages ## | 91 ## Messages ## |
126 | 127 |
127 | 128 |
128 ## Plugins ## | 129 ## Plugins ## |
129 # names of widely used plugins | 130 # names of widely used plugins |
130 TEXT_CMDS = 'TEXT-COMMANDS' | 131 TEXT_CMDS = 'TEXT-COMMANDS' |
132 | |
133 # PubSub event categories | |
134 PS_PEP = "PEP" | |
135 PS_MICROBLOG = "MICROBLOG" | |
136 | |
137 # PubSub | |
138 PS_PUBLISH = "publish" | |
139 PS_RETRACT = "retract" # used for items | |
140 PS_DELETE = "delete" #used for nodes | |
141 PS_ITEM = "item" | |
142 PS_ITEMS = "items" # Can contain publish and retract items | |
143 PS_EVENTS = (PS_ITEMS, PS_DELETE) | |
131 | 144 |
132 | 145 |
133 ## XMLUI ## | 146 ## XMLUI ## |
134 XMLUI_WINDOW = 'window' | 147 XMLUI_WINDOW = 'window' |
135 XMLUI_POPUP = 'popup' | 148 XMLUI_POPUP = 'popup' |
228 | 241 |
229 @classmethod | 242 @classmethod |
230 def bool(cls, value): | 243 def bool(cls, value): |
231 """@return (bool): bool value for associated constant""" | 244 """@return (bool): bool value for associated constant""" |
232 assert isinstance(value, basestring) | 245 assert isinstance(value, basestring) |
233 return value.lower() == cls.BOOL_TRUE | 246 return value.lower() in (cls.BOOL_TRUE, "1") |
234 | 247 |
235 @classmethod | 248 @classmethod |
236 def boolConst(cls, value): | 249 def boolConst(cls, value): |
237 """@return (str): constant associated to bool value""" | 250 """@return (str): constant associated to bool value""" |
238 assert isinstance(value, bool) | 251 assert isinstance(value, bool) |