mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Create user room key if needed (#3108)
This commit is contained in:
parent
82b73a4906
commit
2c87972a3a
6 changed files with 67 additions and 2 deletions
|
@ -183,6 +183,14 @@ func (r *Inviter) PerformInvite(
|
|||
inviteEvent = event
|
||||
}
|
||||
|
||||
// if we invited a local user, we can also create a user room key, if it doesn't exist yet.
|
||||
if isTargetLocal && event.Version() == gomatrixserverlib.RoomVersionPseudoIDs {
|
||||
_, err = r.RSAPI.GetOrCreateUserRoomPrivateKey(ctx, *invitedUser, *validRoomID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get user room private key: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Send the invite event to the roomserver input stream. This will
|
||||
// notify existing users in the room about the invite, update the
|
||||
// membership table and ensure that the event is ready and available
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue