'Cache disco information for an external JID.
The data parameter is the Iq result stanza
containing the disco info to cache, or
the disco#info substanza itself.'

def cache_info(self, jid, node, ifrom, data):

    with self.lock:
        if isinstance(data, Iq):
            data = data['disco_info']
        self.add_node(jid, node, ifrom)
        self.get_node(jid, node, ifrom)['info'] = data
