comparison idavoll/idavoll.py @ 101:b75fcc554358

Added support for disco info meta data.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 02 Jan 2005 20:10:02 +0000
parents cf918d581da5
children f4d725a94202
comparison
equal deleted inserted replaced
100:0228725b705b 101:b75fcc554358
67 if node and not info: 67 if node and not info:
68 return xmpp_error.error_from_iq(iq, 'item-not-found') 68 return xmpp_error.error_from_iq(iq, 'item-not-found')
69 else: 69 else:
70 iq.swapAttributeValues("to", "from") 70 iq.swapAttributeValues("to", "from")
71 iq["type"] = "result" 71 iq["type"] = "result"
72 iq.query.children = info 72 for item in info:
73 #domish.Element.addChild should probably do this for all
74 # subclasses of Element
75 item.parent = iq.query
76
77 iq.query.addChild(item)
73 78
74 return iq 79 return iq
75 80
76 def _error(self, results, iq): 81 def _error(self, result, iq):
82 print "Got error on index %d:" % result.value[1]
83 result.value[0].printBriefTraceback()
77 return xmpp_error.error_from_iq(iq, 'internal-server-error') 84 return xmpp_error.error_from_iq(iq, 'internal-server-error')
78 85
79 def onDiscoItems(self, iq): 86 def onDiscoItems(self, iq):
80 dl = [] 87 dl = []
81 node = iq.query.getAttribute("node") 88 node = iq.query.getAttribute("node")