comparison sat_pubsub/backend.py @ 299:07ad8d8fde77

item publisher is enforced
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 15:58:42 +0100
parents 648f294601c2
children c5acb4995fde
comparison
equal deleted inserted replaced
298:648f294601c2 299:07ad8d8fde77
303 raise error.ItemRequired() 303 raise error.ItemRequired()
304 304
305 items_data = [] 305 items_data = []
306 check_overwrite = False 306 check_overwrite = False
307 for item in items: 307 for item in items:
308 # we enforce publisher (cf XEP-0060 ยง7.1.2.3)
309 item['publisher'] = requestor.full()
308 if persistItems or deliverPayloads: 310 if persistItems or deliverPayloads:
309 item.uri = None 311 item.uri = None
310 item.defaultUri = None 312 item.defaultUri = None
311 if not item.getAttribute("id"): 313 if not item.getAttribute("id"):
312 item["id"] = str(uuid.uuid4()) 314 item["id"] = str(uuid.uuid4())