Changeset 697

Show
Ignore:
Timestamp:
06/19/08 13:44:48 (6 months ago)
Author:
sylvain
Message:

ensured one can ask for subscriptions of a specific node

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • oss/headstock/headstock/api/discovery.py

    r677 r697  
    162162 
    163163class SubscriptionsDiscovery(Entity): 
    164     def __init__(self, from_jid, to_jid, type=u'get', stanza_id=None): 
     164    def __init__(self, from_jid, to_jid, node_name=None, type=u'get', stanza_id=None): 
    165165        Entity.__init__(self, from_jid, to_jid, type, stanza_id) 
    166166        self.subscriptions  = [] 
     167        self.node_name = node_name 
    167168     
    168169    @staticmethod 
     
    170171        iq = Entity.to_element(e) 
    171172        query = E(u'query', namespace=XMPP_PUBSUB_NS, parent=iq) 
    172         E('subscriptions', namespace=XMPP_PUBSUB_NS, parent=query) 
     173        attr = None 
     174        if e.node_name: 
     175            attr = {u'node': e.node_name} 
     176        E('subscriptions', namespace=XMPP_PUBSUB_NS, attributes=attr, parent=query) 
    173177 
    174178        return iq 
     
    180184                                       type=e.get_attribute_value('type'), 
    181185                                       stanza_id=e.get_attribute_value('id')) 
     186 
    182187        for c in e.xml_children: 
    183188            if not isinstance(c, E):