mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Refactor SendMembership - make ban test pass (#1160)
* Refactor SendMembership - make ban test pass * Only check invite auth events for local invites
This commit is contained in:
parent
a06d0921c9
commit
e560619f76
8 changed files with 237 additions and 105 deletions
|
@ -28,7 +28,6 @@ import (
|
|||
|
||||
"github.com/matrix-org/dendrite/clientapi/httputil"
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/clientapi/threepid"
|
||||
"github.com/matrix-org/dendrite/internal/config"
|
||||
"github.com/matrix-org/dendrite/internal/eventutil"
|
||||
"github.com/matrix-org/dendrite/userapi/storage/accounts"
|
||||
|
@ -373,13 +372,9 @@ func createRoom(
|
|||
|
||||
// If this is a direct message then we should invite the participants.
|
||||
for _, invitee := range r.Invite {
|
||||
// Build the membership request.
|
||||
body := threepid.MembershipRequest{
|
||||
UserID: invitee,
|
||||
}
|
||||
// Build the invite event.
|
||||
inviteEvent, err := buildMembershipEvent(
|
||||
req.Context(), body, accountDB, device, gomatrixserverlib.Invite,
|
||||
req.Context(), invitee, "", accountDB, device, gomatrixserverlib.Invite,
|
||||
roomID, true, cfg, evTime, rsAPI, asAPI,
|
||||
)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue