# HG changeset patch # User Ralph Meijer # Date 1099674950 0 # Node ID 445a61f872b6d3c9425c3cf6182748e2c280df69 # Parent 55fa890ef60b8a474eaf1cb67a3d870d81b61870 Use NodeCreationService for pgsql backend, too. Fix onDiscoInfo(). diff -r 55fa890ef60b -r 445a61f872b6 idavoll/idavoll.py --- a/idavoll/idavoll.py Fri Nov 05 17:14:42 2004 +0000 +++ b/idavoll/idavoll.py Fri Nov 05 17:15:50 2004 +0000 @@ -29,8 +29,12 @@ xmlstream.addObserver(IQ_SET, self.iqFallback, -1) def getFeatures(self, node): + features = [] + if not node: - return [NS_DISCO_ITEMS, NS_VERSION] + features.extend([NS_DISCO_ITEMS, NS_VERSION]) + + return features def onVersion(self, iq): iq.swapAttributeValues("to", "from") @@ -52,7 +56,7 @@ if hasattr(c, "getFeatures"): features.extend(c.getFeatures(node)) - if not features and not identities and not node: + if node and not features and not identities: xmpp_error.error_from_iq(iq, 'item-not-found') else: iq.swapAttributeValues("to", "from") @@ -110,10 +114,9 @@ bsc.setServiceParent(bs) component.IService(bsc).setServiceParent(sm) - if config['backend'] == 'memory': - bsc = b.NodeCreationService() - bsc.setServiceParent(bs) - component.IService(bsc).setServiceParent(sm) + bsc = b.NodeCreationService() + bsc.setServiceParent(bs) + component.IService(bsc).setServiceParent(sm) s = IdavollService() s.setServiceParent(sm)