Cleanup remaining statekey usage for senderIDs (#3106)
This commit is contained in:
parent
832ccc32f6
commit
77d9e4e93d
62 changed files with 760 additions and 455 deletions
|
|
@ -134,12 +134,12 @@ func (r *Inviter) PerformInvite(
|
|||
return api.ErrInvalidID{Err: fmt.Errorf("the invite must be from a local user")}
|
||||
}
|
||||
|
||||
if event.StateKey() == nil {
|
||||
if event.StateKey() == nil || *event.StateKey() == "" {
|
||||
return fmt.Errorf("invite must be a state event")
|
||||
}
|
||||
invitedUser, err := spec.NewUserID(*event.StateKey(), true)
|
||||
if err != nil {
|
||||
return spec.InvalidParam("The user ID is invalid")
|
||||
invitedUser, err := r.RSAPI.QueryUserIDForSender(ctx, event.RoomID(), spec.SenderID(*event.StateKey()))
|
||||
if err != nil || invitedUser == nil {
|
||||
return spec.InvalidParam("Could not find the matching senderID for this user")
|
||||
}
|
||||
isTargetLocal := r.Cfg.Matrix.IsLocalServerName(invitedUser.Domain())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue