2021-07-02 20:29:54 +02:00
|
|
|
import { generateFingerprint, getDevicesForContact, } from '../utils.js';
|
2021-04-12 04:29:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
const ConverseMixins = {
|
|
|
|
|
|
|
|
generateFingerprints: async function (jid) {
|
|
|
|
const devices = await getDevicesForContact(jid);
|
|
|
|
return Promise.all(devices.map(d => generateFingerprint(d)));
|
|
|
|
},
|
|
|
|
|
|
|
|
getDeviceForContact: function (jid, device_id) {
|
|
|
|
return getDevicesForContact(jid).then(devices => devices.get(device_id));
|
|
|
|
},
|
|
|
|
|
|
|
|
contactHasOMEMOSupport: async function (jid) {
|
|
|
|
/* Checks whether the contact advertises any OMEMO-compatible devices. */
|
|
|
|
const devices = await getDevicesForContact(jid);
|
|
|
|
return devices.length > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ConverseMixins;
|