aboutsummaryrefslogtreecommitdiff
path: root/userapi/internal/key_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/internal/key_api.go')
-rw-r--r--userapi/internal/key_api.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/userapi/internal/key_api.go b/userapi/internal/key_api.go
index 786a2dcd..422898c7 100644
--- a/userapi/internal/key_api.go
+++ b/userapi/internal/key_api.go
@@ -711,9 +711,15 @@ func (a *UserInternalAPI) uploadLocalDeviceKeys(ctx context.Context, req *api.Pe
}
return
}
- err = emitDeviceKeyChanges(a.KeyChangeProducer, existingKeys, keysToStore, req.OnlyDisplayNameUpdates)
- if err != nil {
- util.GetLogger(ctx).Errorf("Failed to emitDeviceKeyChanges: %s", err)
+
+ // If the request does _not_ come right after registering an account
+ // inform downstream components. However, we're fine with just creating the
+ // database entries above in other cases.
+ if !req.FromRegistration {
+ err = emitDeviceKeyChanges(a.KeyChangeProducer, existingKeys, keysToStore, req.OnlyDisplayNameUpdates)
+ if err != nil {
+ util.GetLogger(ctx).Errorf("Failed to emitDeviceKeyChanges: %s", err)
+ }
}
}