comparison src/server/blog.py @ 882:d3d2b97aa12c

blog (atom): removed hard ATOM_MAX_ITEMS value as it need to be used with MAM, may come back in the future
author Goffi <goffi@goffi.org>
date Wed, 09 Mar 2016 20:40:25 +0100
parents 6bdee34fa2f4
children 763da94ba28b
comparison
equal deleted inserted replaced
881:6bdee34fa2f4 882:d3d2b97aa12c
39 39
40 from libervia.server.html_tools import sanitizeHtml, convertNewLinesToXHTML 40 from libervia.server.html_tools import sanitizeHtml, convertNewLinesToXHTML
41 from libervia.server.constants import Const as C 41 from libervia.server.constants import Const as C
42 42
43 NS_ATOM = 'http://www.w3.org/2005/Atom' 43 NS_ATOM = 'http://www.w3.org/2005/Atom'
44 ATOM_MAX_ITEMS = 20
45 PARAMS_TO_GET = (C.STATIC_BLOG_PARAM_TITLE, C.STATIC_BLOG_PARAM_BANNER, C.STATIC_BLOG_PARAM_KEYWORDS, C.STATIC_BLOG_PARAM_DESCRIPTION) 44 PARAMS_TO_GET = (C.STATIC_BLOG_PARAM_TITLE, C.STATIC_BLOG_PARAM_BANNER, C.STATIC_BLOG_PARAM_KEYWORDS, C.STATIC_BLOG_PARAM_DESCRIPTION)
46 re_strip_empty_div = re.compile(r"<div ?/>|<div> *?</div>") 45 re_strip_empty_div = re.compile(r"<div ?/>|<div> *?</div>")
47 46
48 # TODO: chech disco features and use max_items when RSM is not available 47 # TODO: chech disco features and use max_items when RSM is not available
49 # FIXME: Deferred are not used 48 # FIXME: Deferred are not used
191 max_items = 0 190 max_items = 0
192 # TODO: use max_items only when RSM is not available 191 # TODO: use max_items only when RSM is not available
193 192
194 if request.atom: 193 if request.atom:
195 request.extra_dict.update(request.mam_extra) 194 request.extra_dict.update(request.mam_extra)
196 self.getAtom(pub_jid, ATOM_MAX_ITEMS, request.extra_dict, request.extra_comments_dict, request, profile) 195 self.getAtom(pub_jid, max_items, request.extra_dict, request.extra_comments_dict, request, profile)
197 196
198 elif request.item_id: 197 elif request.item_id:
199 # we can't merge mam_extra now because we'll use item_ids 198 # we can't merge mam_extra now because we'll use item_ids
200 self.getItemById(pub_jid, request.item_id, request.extra_dict, 199 self.getItemById(pub_jid, request.item_id, request.extra_dict,
201 request.extra_comments_dict, request, profile) 200 request.extra_comments_dict, request, profile)