comparison idavoll/gateway.py @ 203:2c46e6664680

Match wokkel API change for PubSubClient.
author Ralph Meijer <ralphm@ik.nu>
date Mon, 14 Jul 2008 09:16:16 +0000
parents e404775b12df
children b4bf0a5ce50d
comparison
equal deleted inserted replaced
202:77c61e2b8c75 203:2c46e6664680
409 self.unsubscribe(jid, nodeIdentifier, self.jid) 409 self.unsubscribe(jid, nodeIdentifier, self.jid)
410 410
411 return defer.succeed(None) 411 return defer.succeed(None)
412 412
413 413
414 def itemsReceived(self, recipient, service, nodeIdentifier, items): 414 def itemsReceived(self, event):
415 """ 415 """
416 Fire up HTTP client to do callback 416 Fire up HTTP client to do callback
417 """ 417 """
418 418
419 atomEntries = extractAtomEntries(items) 419 atomEntries = extractAtomEntries(event.items)
420 420
421 # Don't notify if there are no atom entries 421 # Don't notify if there are no atom entries
422 if not atomEntries: 422 if not atomEntries:
423 return 423 return
424 424
425 if len(atomEntries) == 1: 425 if len(atomEntries) == 1:
426 contentType = 'application/atom+xml;type=entry' 426 contentType = 'application/atom+xml;type=entry'
427 payload = atomEntries[0] 427 payload = atomEntries[0]
428 else: 428 else:
429 contentType = 'application/atom+xml;type=feed' 429 contentType = 'application/atom+xml;type=feed'
430 payload = constructFeed(service, nodeIdentifier, atomEntries, 430 payload = constructFeed(event.sender, event.nodeIdentifier,
431 atomEntries,
431 title='Received item collection') 432 title='Received item collection')
432 433
433 self.callCallbacks(service, nodeIdentifier, payload, contentType) 434 self.callCallbacks(event.sender, event.nodeIdentifier, payload,
434 435 contentType)
435 436
436 def deleteReceived(self, recipient, service, nodeIdentifier): 437
438 def deleteReceived(self, event):
437 """ 439 """
438 Fire up HTTP client to do callback 440 Fire up HTTP client to do callback
439 """ 441 """
440 442
441 self.callCallbacks(service, nodeIdentifier, eventType='DELETED') 443 self.callCallbacks(event.sender, event.nodeIdentifier,
444 eventType='DELETED')
442 445
443 446
444 def _postTo(self, callbacks, service, nodeIdentifier, 447 def _postTo(self, callbacks, service, nodeIdentifier,
445 payload=None, contentType=None, eventType=None): 448 payload=None, contentType=None, eventType=None):
446 postdata = None 449 postdata = None