changeset 2205:582359de7268

tmp(wokkel/pubsub): removed affiliations attribute which was there twice + added missing _render_affiliations
author Goffi <goffi@goffi.org>
date Sun, 26 Mar 2017 16:57:53 +0200
parents afc703419186
children 59d3de85a0cb
files src/tmp/wokkel/pubsub.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/tmp/wokkel/pubsub.py	Thu Mar 23 21:04:01 2017 +0100
+++ b/src/tmp/wokkel/pubsub.py	Sun Mar 26 16:57:53 2017 +0200
@@ -287,7 +287,6 @@
 
     verb = None
 
-    affiliations = None
     items = None
     itemIdentifiers = None
     maxItems = None
@@ -615,6 +614,11 @@
 
                 self.affiliations[entity] = affiliation
 
+    def _render_affiliations(self, verbElement):
+        for entity, affiliation in self.affiliations.iteritems():
+            affiliationElement = verbElement.addElement((NS_PUBSUB_OWNER, 'affiliation'))
+            affiliationElement['jid'] = entity.full()
+            affiliationElement['affiliation'] = affiliation
 
     def _parse_notify(self, verbElement):
         value = verbElement.getAttribute('notify')