mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 09:23:09 -06:00
Remove unused parameter
This commit is contained in:
parent
3a41e21acc
commit
36f54b36fb
|
|
@ -85,8 +85,8 @@ var (
|
||||||
// fills the Matrix ID in the request body so a normal invite membership event
|
// fills the Matrix ID in the request body so a normal invite membership event
|
||||||
// can be emitted.
|
// can be emitted.
|
||||||
func CheckAndProcessInvite(
|
func CheckAndProcessInvite(
|
||||||
req *http.Request, device *authtypes.Device, body *MembershipRequest,
|
device *authtypes.Device, body *MembershipRequest, cfg config.Dendrite,
|
||||||
cfg config.Dendrite, queryAPI api.RoomserverQueryAPI, db *accounts.Database,
|
queryAPI api.RoomserverQueryAPI, db *accounts.Database,
|
||||||
producer *producers.RoomserverProducer, membership string, roomID string,
|
producer *producers.RoomserverProducer, membership string, roomID string,
|
||||||
) (inviteStoredOnIDServer bool, err error) {
|
) (inviteStoredOnIDServer bool, err error) {
|
||||||
if membership != "invite" || (body.Address == "" && body.IDServer == "" && body.Medium == "") {
|
if membership != "invite" || (body.Address == "" && body.IDServer == "" && body.Medium == "") {
|
||||||
|
|
@ -100,7 +100,7 @@ func CheckAndProcessInvite(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
lookupRes, storeInviteRes, err := queryIDServer(req, db, cfg, device, body, roomID)
|
lookupRes, storeInviteRes, err := queryIDServer(db, cfg, device, body, roomID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -132,8 +132,8 @@ func CheckAndProcessInvite(
|
||||||
// Returns a representation of the response for both cases.
|
// Returns a representation of the response for both cases.
|
||||||
// Returns an error if a check or a request failed.
|
// Returns an error if a check or a request failed.
|
||||||
func queryIDServer(
|
func queryIDServer(
|
||||||
req *http.Request, db *accounts.Database, cfg config.Dendrite,
|
db *accounts.Database, cfg config.Dendrite, device *authtypes.Device,
|
||||||
device *authtypes.Device, body *MembershipRequest, roomID string,
|
body *MembershipRequest, roomID string,
|
||||||
) (lookupRes *idServerLookupResponse, storeInviteRes *idServerStoreInviteResponse, err error) {
|
) (lookupRes *idServerLookupResponse, storeInviteRes *idServerStoreInviteResponse, err error) {
|
||||||
if err = isTrusted(body.IDServer, cfg); err != nil {
|
if err = isTrusted(body.IDServer, cfg); err != nil {
|
||||||
return
|
return
|
||||||
|
|
@ -159,7 +159,7 @@ func queryIDServer(
|
||||||
if lookupRes.NotBefore > now || now > lookupRes.NotAfter {
|
if lookupRes.NotBefore > now || now > lookupRes.NotAfter {
|
||||||
// If the current timestamp isn't in the time frame in which the association
|
// If the current timestamp isn't in the time frame in which the association
|
||||||
// is known to be valid, re-run the query
|
// is known to be valid, re-run the query
|
||||||
return queryIDServer(req, db, cfg, device, body, roomID)
|
return queryIDServer(db, cfg, device, body, roomID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the request signatures and send an error if one isn't valid
|
// Check the request signatures and send an error if one isn't valid
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ func SendMembership(
|
||||||
}
|
}
|
||||||
|
|
||||||
inviteStored, err := threepid.CheckAndProcessInvite(
|
inviteStored, err := threepid.CheckAndProcessInvite(
|
||||||
req, device, &body, cfg, queryAPI, accountDB, producer, membership, roomID,
|
device, &body, cfg, queryAPI, accountDB, producer, membership, roomID,
|
||||||
)
|
)
|
||||||
if err == threepid.ErrMissingParameter {
|
if err == threepid.ErrMissingParameter {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue