Example #1
0
    def _disco_info_results(self, results, iq, room = None):
        
        info = []
        for i in results:
            info.extend(i[1])

        # a better fix to the twisted bug is just create a new iq 
        riq = xsIQ(self.xmlstream, 'result')

        riq['id']   = iq['id']
        riq['to']   = iq['from']
        riq['from'] = iq['to']
        riq.addElement('query', DISCO_NS_INFO)
                
        if room and not info:
            return error.error_from_iq(iq, 'item-not-found')
        else:
            for item in info:
                item.parent = riq.query
                
                riq.query.addChild(item)
        
        
        iq.handled = True
        return riq
Example #2
0
 def iqFallback(self, iq):
     if iq.handled == True:
         return
     self.send(error.error_from_iq(iq, 'service-unavailable'))
Example #3
0
 def _error(self, result, iq):
     args = getattr(result.value, 'args', None)
     if not args:
         result.value[0].printBriefTraceback()
     return error.error_from_iq(iq, 'internal-server-error')