diff src/plugins/plugin_xep_0060.py @ 615:6f4c31192c7c

plugins XEP-0060, XEP-0277, groupblog: comments implementation (first draft, not finished yet): - PubSub options constants are moved to XEP-0060 - comments url are generated/parsed according to XEP-0277 - microblog data can now have the following keys: - "comments", with the url as given in the <link> tag - "comments_service", with the jid of the PubSub service hosting the comments - "comments_node", with the parsed node - comments nodes use different access_model according to parent microblog item access - publisher is not verified yet, see FIXME warning - so far, comments node are automatically subscribed - some bug fixes
author Goffi <goffi@goffi.org>
date Mon, 20 May 2013 23:21:29 +0200
parents 84a6e83157c2
children 3c304929af74
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Sun Apr 07 23:27:07 2013 +0200
+++ b/src/plugins/plugin_xep_0060.py	Mon May 20 23:21:29 2013 +0200
@@ -18,12 +18,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from logging import debug, info, error
-from twisted.internet import protocol
-from twisted.words.protocols.jabber import client, jid
-from twisted.words.protocols.jabber import error as jab_error
-import twisted.internet.error
 
-from wokkel import disco, iwokkel, pubsub
+from wokkel import disco, pubsub
 
 from zope.interface import implements
 
@@ -40,6 +36,16 @@
 
 
 class XEP_0060(object):
+    OPT_ACCESS_MODEL = 'pubsub#access_model'
+    OPT_PERSIST_ITEMS = 'pubsub#persist_items'
+    OPT_MAX_ITEMS = 'pubsub#max_items'
+    OPT_DELIVER_PAYLOADS = 'pubsub#deliver_payloads'
+    OPT_SEND_ITEM_SUBSCRIBE = 'pubsub#send_item_subscribe'
+    OPT_NODE_TYPE = 'pubsub#node_type'
+    OPT_SUBSCRIPTION_TYPE = 'pubsub#subscription_type'
+    OPT_SUBSCRIPTION_DEPTH = 'pubsub#subscription_depth'
+    OPT_ROSTER_GROUPS_ALLOWED = 'pubsub#roster_groups_allowed'
+    OPT_PUBLISH_MODEL = 'pubsub#publish_model'
 
     def __init__(self, host):
         info(_("PubSub plugin initialization"))
@@ -140,9 +146,9 @@
         #TODO: manage delete event
         debug(_("Publish node deleted"))
 
-    def purgeReceived(self, event):
-        import pdb
-        pdb.set_trace()
+    # def purgeReceived(self, event):
+
+
 
     def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
         _disco_info = []