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
This commit is contained in:
Goffi 2013-05-20 23:21:29 +02:00
commit c1b5ccf1d2

View file

@ -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 @@ PLUGIN_INFO = {
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 @@ class SatPubSubClient(pubsub.PubSubClient):
#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 = []