'Add or replace all identities for a JID/node combination.
The data parameter should include:
identities -- A list of identities in tuple form:
(category, type, name, lang)'

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

    with self.lock:
        identities = data.get('identities', set())
        self.add_node(jid, node)
        self.get_node(jid, node)['info']['identities'] = identities
