mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 16:13:10 -06:00
Small tweaks to invite logic
This commit is contained in:
parent
a17f073de2
commit
0c81094106
|
|
@ -76,10 +76,16 @@ func InviteV2(
|
|||
}
|
||||
}
|
||||
|
||||
if inviteReq.Event().EventID() != eventID {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.BadJSON("The event ID in the request path must match the event ID in the invite event JSON"),
|
||||
}
|
||||
}
|
||||
|
||||
input := gomatrixserverlib.HandleInviteInput{
|
||||
RoomVersion: inviteReq.RoomVersion(),
|
||||
RoomID: roomID,
|
||||
EventID: eventID,
|
||||
InvitedUser: *invitedUser,
|
||||
KeyID: cfg.Matrix.KeyID,
|
||||
PrivateKey: cfg.Matrix.PrivateKey,
|
||||
|
|
@ -160,10 +166,16 @@ func InviteV1(
|
|||
}
|
||||
}
|
||||
|
||||
if event.EventID() != eventID {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: spec.BadJSON("The event ID in the request path must match the event ID in the invite event JSON"),
|
||||
}
|
||||
}
|
||||
|
||||
input := gomatrixserverlib.HandleInviteInput{
|
||||
RoomVersion: roomVer,
|
||||
RoomID: roomID,
|
||||
EventID: eventID,
|
||||
InvitedUser: *invitedUser,
|
||||
KeyID: cfg.Matrix.KeyID,
|
||||
PrivateKey: cfg.Matrix.PrivateKey,
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -22,7 +22,7 @@ require (
|
|||
github.com/matrix-org/dugong v0.0.0-20210921133753-66e6b1c67e2e
|
||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91
|
||||
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524174311-4d08a8f8f800
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524200844-9d5ee2fd021e
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a
|
||||
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66
|
||||
github.com/mattn/go-sqlite3 v1.14.16
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -323,8 +323,8 @@ github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91 h1:s7fexw
|
|||
github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 h1:kHKxCOLcHH8r4Fzarl4+Y3K5hjothkVW5z7T1dUM11U=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524174311-4d08a8f8f800 h1:iZp0UXqkg7x65gccTD/1M8UbFraJLVW94AFeNqtXISw=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524174311-4d08a8f8f800/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524200844-9d5ee2fd021e h1:kY6xpR38+BUUMKYfKD038HphSQf8IRQaxiSwjOXh86g=
|
||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20230524200844-9d5ee2fd021e/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU=
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a h1:awrPDf9LEFySxTLKYBMCiObelNx/cBuv/wzllvCCH3A=
|
||||
github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a/go.mod h1:HchJX9oKMXaT2xYFs0Ha/6Zs06mxLU8k6F1ODnrGkeQ=
|
||||
github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y=
|
||||
|
|
|
|||
|
|
@ -59,8 +59,7 @@ func (q *QueryState) GetState(ctx context.Context, roomID spec.RoomID, stateWant
|
|||
}
|
||||
stateEvents, err := q.Database.Events(ctx, info.RoomVersion, stateNIDs)
|
||||
if err != nil {
|
||||
// TODO: really? no err?
|
||||
return nil, nil
|
||||
return nil, fmt.Errorf("failed to obtain required events: %w", err)
|
||||
}
|
||||
|
||||
events := []gomatrixserverlib.PDU{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue