mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 21:32:46 +00:00
Add DeviceKeysEqual
(#2219)
* Add `DeviceKeysEqual` * Update check order * Fix check * Tweak conditions again * One more time * Single return value
This commit is contained in:
parent
34116178e8
commit
c7811e9d71
2 changed files with 22 additions and 1 deletions
|
@ -718,7 +718,7 @@ func emitDeviceKeyChanges(producer KeyChangeProducer, existing, new []api.Device
|
|||
for _, existingKey := range existing {
|
||||
// Do not treat the absence of keys as equal, or else we will not emit key changes
|
||||
// when users delete devices which never had a key to begin with as both KeyJSONs are nil.
|
||||
if bytes.Equal(existingKey.KeyJSON, newKey.KeyJSON) && len(existingKey.KeyJSON) > 0 {
|
||||
if existingKey.DeviceKeysEqual(&newKey) {
|
||||
exists = true
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue