summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-08-19 16:09:47 -0700
committerNathan Fritz <nathan@andyet.net>2010-08-19 16:09:47 -0700
commitd150b35464742de7af9b3105bc7eeb55171b96ee (patch)
treef1dce9115efbe4c85d37bc27d6ae35f1e937a043 /sleekxmpp/plugins/xep_0030.py
parent21b7109c06695955632692814fed11b3717e0fc7 (diff)
parente4240dd593207a5912de996c42451b3946f113b2 (diff)
downloadslixmpp-d150b35464742de7af9b3105bc7eeb55171b96ee.tar.gz
slixmpp-d150b35464742de7af9b3105bc7eeb55171b96ee.tar.bz2
slixmpp-d150b35464742de7af9b3105bc7eeb55171b96ee.tar.xz
slixmpp-d150b35464742de7af9b3105bc7eeb55171b96ee.zip
fixed todo merge
Diffstat (limited to 'sleekxmpp/plugins/xep_0030.py')
-rw-r--r--sleekxmpp/plugins/xep_0030.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/sleekxmpp/plugins/xep_0030.py b/sleekxmpp/plugins/xep_0030.py
index 6a31d243..a9d8d6a7 100644
--- a/sleekxmpp/plugins/xep_0030.py
+++ b/sleekxmpp/plugins/xep_0030.py
@@ -3,14 +3,14 @@
Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
- See the file license.txt for copying permissio
+ See the file LICENSE for copying permission.
"""
import logging
from . import base
from .. xmlstream.handler.callback import Callback
from .. xmlstream.matcher.xpath import MatchXPath
-from .. xmlstream.stanzabase import ElementBase, ET, JID
+from .. xmlstream.stanzabase import registerStanzaPlugin, ElementBase, ET, JID
from .. stanza.iq import Iq
class DiscoInfo(ElementBase):
@@ -138,6 +138,9 @@ class DiscoNode(object):
self.info = DiscoInfo()
self.items = DiscoItems()
+ self.info['node'] = name
+ self.items['node'] = name
+
# This is a bit like poor man's inheritance, but
# to simplify adding information to the node we
# map node functions to either the info or items
@@ -201,8 +204,8 @@ class xep_0030(base.base_plugin):
DiscoInfo.namespace)),
self.handle_info_query))
- self.xmpp.stanzaPlugin(Iq, DiscoInfo)
- self.xmpp.stanzaPlugin(Iq, DiscoItems)
+ registerStanzaPlugin(Iq, DiscoInfo)
+ registerStanzaPlugin(Iq, DiscoItems)
self.xmpp.add_event_handler('disco_items_request', self.handle_disco_items)
self.xmpp.add_event_handler('disco_info_request', self.handle_disco_info)
@@ -290,21 +293,21 @@ class xep_0030(base.base_plugin):
# Older interface methods for backwards compatibility
- def getInfo(self, jid, node=''):
+ def getInfo(self, jid, node='', dfrom=None):
iq = self.xmpp.Iq()
iq['type'] = 'get'
iq['to'] = jid
- iq['from'] = self.xmpp.fulljid
+ iq['from'] = dfrom
iq['disco_info']['node'] = node
- iq.send()
+ return iq.send()
- def getItems(self, jid, node=''):
+ def getItems(self, jid, node='', dfrom=None):
iq = self.xmpp.Iq()
iq['type'] = 'get'
iq['to'] = jid
- iq['from'] = self.xmpp.fulljid
+ iq['from'] = dfrom
iq['disco_items']['node'] = node
- iq.send()
+ return iq.send()
def add_feature(self, feature, node='main'):
self.add_node(node)