Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dax/jmc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rousselie <dax@happycoders.org>2007-07-11 10:13:14 +0400
committerDavid Rousselie <dax@happycoders.org>2007-07-11 10:13:14 +0400
commit721a33d5d50e6e60d5e7e04b221dab1b0e69da74 (patch)
tree35e5adcdad665c03065d9071aeed8b399ad4a320
parentfcf3a1bdbf20690b8c0347d07be3db782cb73a81 (diff)
Activate ad-hoc commands support
darcs-hash:20070711061314-86b55-fb79a117909a5eb12fa81b251bd94d6f3dc78ed3.gz
-rw-r--r--src/jmc/jabber/disco.py8
-rw-r--r--src/jmc/jabber/tests/disco.py3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/jmc/jabber/disco.py b/src/jmc/jabber/disco.py
index 6bc5c12..0e9fe4e 100644
--- a/src/jmc/jabber/disco.py
+++ b/src/jmc/jabber/disco.py
@@ -20,13 +20,13 @@
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
-from jcl.jabber.disco import RootDiscoGetInfoHandler
+from jcl.jabber.command import CommandRootDiscoGetInfoHandler
-class MailRootDiscoGetInfoHandler(RootDiscoGetInfoHandler):
+class MailRootDiscoGetInfoHandler(CommandRootDiscoGetInfoHandler):
def handle(self, stanza, lang_class, node, disco_obj, data):
"""Add jabber:iq:gateway support"""
- disco_infos = RootDiscoGetInfoHandler.handle(self, stanza, lang_class,
- node, disco_obj, data)
+ disco_infos = CommandRootDiscoGetInfoHandler.handle(self, stanza, lang_class,
+ node, disco_obj, data)
disco_infos[0].add_feature("jabber:iq:gateway")
disco_infos[0].add_identity(self.component.name, "headline", "newmail")
return disco_infos
diff --git a/src/jmc/jabber/tests/disco.py b/src/jmc/jabber/tests/disco.py
index d65fb79..9ca6dc2 100644
--- a/src/jmc/jabber/tests/disco.py
+++ b/src/jmc/jabber/tests/disco.py
@@ -50,6 +50,9 @@ class MailRootDiscoGetInfoHandler_TestCase(unittest.TestCase):
# stanza, lang_class, node, disco_obj, data
disco_infos = handler.handle(None, None, None, None, None)
self.assertTrue(disco_infos[0].has_feature("jabber:iq:gateway"))
+ self.assertTrue(disco_infos[0].has_feature("http://jabber.org/protocol/disco#info"))
+ self.assertTrue(disco_infos[0].has_feature("http://jabber.org/protocol/disco#items"))
+ self.assertTrue(disco_infos[0].has_feature("http://jabber.org/protocol/commands"))
self.assertEquals(len(disco_infos[0].get_identities()), 2)
self.assertTrue(disco_infos[0].identity_is("gateway", "smtp"))
self.assertTrue(disco_infos[0].identity_is("headline", "newmail"))