diff src/plugins/plugin_xep_0277.py @ 465:78e67a59d51d

plugin groupblog: added getLastGroupBlogs method
author Goffi <goffi@goffi.org>
date Sat, 24 Mar 2012 17:48:12 +0100
parents cf005701624b
children c97640c90a94
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py	Sat Mar 24 17:46:42 2012 +0100
+++ b/src/plugins/plugin_xep_0277.py	Sat Mar 24 17:48:12 2012 +0100
@@ -75,7 +75,7 @@
                                doc = {
                                      })
 
-    def _item2mbdata(self, item):
+    def item2mbdata(self, item):
         """Convert an XML Item to microblog data used in bridge API
         @param item: domish.Element of microblog item
         @return: microblog data (dictionary)"""
@@ -110,7 +110,7 @@
 
     def microblogCB(self, itemsEvent, profile):
         for item in itemsEvent.items:
-            microblog_data = self._item2mbdata(item)
+            microblog_data = self.item2mbdata(item)
             self.host.bridge.personalEvent(itemsEvent.sender.full(), "MICROBLOG", microblog_data, profile)
 
     def data2entry(self, data, profile):
@@ -149,14 +149,14 @@
     def getLastMicroblogs(self, pub_jid, max_items=10, profile_key='@DEFAULT@', callback=None, errback=None):
         """Get the last published microblogs
         @param pub_jid: jid of the publisher
-        @param max_items: how many microblogs we wants to get
+        @param max_items: how many microblogs we want to get
         @param profile_key: profile key
         @param callback: used for the async answer
         @param errback: used for the async answer
         """
         assert(callback)
         d = self.host.plugins["XEP-0060"].getItems(jid.JID(pub_jid), NS_MICROBLOG, max_items=max_items, profile_key=profile_key)
-        d.addCallbacks(lambda items: callback(map(self._item2mbdata, items)), errback)
+        d.addCallbacks(lambda items: callback(map(self.item2mbdata, items)), errback)
         
     def setMicroblogAccess(self, access="presence", profile_key='@DEFAULT@', callback=None, errback=None):
         """Create a microblog node on PEP with given access