plugin XEP-0060: addManagedNode callbacks now use client syntax instead of profile
This commit is contained in:
parent
359b3a1b43
commit
c56d3fc759
1 changed files with 10 additions and 11 deletions
|
|
@ -78,16 +78,15 @@ class XEP_0163(object):
|
|||
self.pep_events.add(node)
|
||||
if notify:
|
||||
self.pep_events.add(node + "+notify")
|
||||
def filterPEPEvent(itemsEvent, profile):
|
||||
def filterPEPEvent(client, itemsEvent):
|
||||
"""Ignore messages which are not coming from PEP (i.e. main server)
|
||||
|
||||
@param itemsEvent(pubsub.ItemsEvent): pubsub event
|
||||
@param profile(unicode): %(doc_profile)s
|
||||
"""
|
||||
if itemsEvent.sender.user or itemsEvent.sender.resource:
|
||||
log.debug("ignoring non PEP event from {} (profile={})".format(itemsEvent.sender.full(), profile))
|
||||
log.debug("ignoring non PEP event from {} (profile={})".format(itemsEvent.sender.full(), client.profile))
|
||||
return
|
||||
in_callback(itemsEvent, profile)
|
||||
in_callback(itemsEvent, client.profile)
|
||||
|
||||
self.host.plugins["XEP-0060"].addManagedNode(node, items_cb=filterPEPEvent)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue