OMEMO fixes for completely new user
Fix bugs related to there not being a server-side device list (not even an empty one) for a new user.
This commit is contained in:
parent
89a3c81a19
commit
731e98b07c
@ -36,7 +36,7 @@ export default {
|
||||
async get (jid, create=false) {
|
||||
const list = _converse.devicelists.get(jid) ||
|
||||
(create ? _converse.devicelists.create({ jid }) : null);
|
||||
await list.initialized;
|
||||
await list?.initialized;
|
||||
return list;
|
||||
}
|
||||
},
|
||||
|
@ -30,7 +30,7 @@ const DeviceList = Model.extend({
|
||||
|
||||
async onDevicesFound (collection) {
|
||||
if (collection.length === 0) {
|
||||
let ids;
|
||||
let ids = [];
|
||||
try {
|
||||
ids = await this.fetchDevicesFromServer();
|
||||
} catch (e) {
|
||||
|
@ -453,7 +453,7 @@ export async function getDevicesForContact (jid) {
|
||||
|
||||
export async function generateDeviceID () {
|
||||
/* Generates a device ID, making sure that it's unique */
|
||||
const devicelist = await api.omemo.devicelists.get(_converse.bare_jid);
|
||||
const devicelist = await api.omemo.devicelists.get(_converse.bare_jid, true);
|
||||
const existing_ids = devicelist.devices.pluck('id');
|
||||
let device_id = libsignal.KeyHelper.generateRegistrationId();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user