diff src/plugins/plugin_xep_0163.py @ 2305:972e33507609

plugin XEP-0060: addManagedNode callbacks now use client syntax instead of profile
author Goffi <goffi@goffi.org>
date Wed, 05 Jul 2017 15:04:43 +0200
parents b5befe7722d3
children 8b37a62336c3
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0163.py	Wed Jul 05 15:02:52 2017 +0200
+++ b/src/plugins/plugin_xep_0163.py	Wed Jul 05 15:04:43 2017 +0200
@@ -78,16 +78,15 @@
         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)