do store our own device, otherwise need special case verifying own msgs

This commit is contained in:
Bruno Windels 2020-09-08 15:24:36 +02:00
parent 1cd93df81c
commit b653022a5a

View File

@ -205,10 +205,6 @@ export class DeviceTracker {
if (typeof ed25519Key !== "string" || typeof curve25519Key !== "string") { if (typeof ed25519Key !== "string" || typeof curve25519Key !== "string") {
return false; return false;
} }
// don't store our own device
if (userId === this._ownUserId && deviceId === this._ownDeviceId) {
return false;
}
return this._hasValidSignature(deviceKeys); return this._hasValidSignature(deviceKeys);
}); });
const verifiedKeys = verifiedEntries.map(([, deviceKeys]) => deviceKeys); const verifiedKeys = verifiedEntries.map(([, deviceKeys]) => deviceKeys);
@ -287,7 +283,7 @@ export class DeviceTracker {
if (queriedDevices && queriedDevices.length) { if (queriedDevices && queriedDevices.length) {
flattenedDevices = flattenedDevices.concat(queriedDevices); flattenedDevices = flattenedDevices.concat(queriedDevices);
} }
// filter out our own devices if it got in somehow (even though we should not store it) // filter out our own device
const devices = flattenedDevices.filter(device => { const devices = flattenedDevices.filter(device => {
return !(device.userId === this._ownUserId && device.deviceId === this._ownDeviceId); return !(device.userId === this._ownUserId && device.deviceId === this._ownDeviceId);
}); });