changeset 38:e3e02ead6bde

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 e8296d7bfeb1
children 2cc92af0e13a
files wokkel/pubsub.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/pubsub.py	Thu Mar 23 20:59:25 2017 +0100
+++ b/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')