Пример #1
0
    def handle_iq(self, session, iq):
        children = iq.getChildren()

        # Respond to pings so server doesn't kick us
        if iq.getType() == 'get' and children and children[0].getName() == 'ping':
            response = Iq(to=iq.getFrom(), frm=iq.getTo(), typ='result')
            response.setID(iq.getID())
            session.send(response)
            raise NodeProcessed