mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Revert "Signed event copies should be complete"
This reverts commit cef7db0469
.
This commit is contained in:
parent
cef7db0469
commit
27ca2da756
4 changed files with 8 additions and 19 deletions
|
@ -161,16 +161,9 @@ func processInvite(
|
|||
}
|
||||
|
||||
// Sign the event so that other servers will know that we have received the invite.
|
||||
signedEvent, err := event.Sign(
|
||||
signedEvent := event.Sign(
|
||||
string(cfg.Matrix.ServerName), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey,
|
||||
)
|
||||
if err != nil {
|
||||
util.GetLogger(ctx).WithError(err).Error("event.Sign failed")
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
JSON: jsonerror.InternalServerError(),
|
||||
}
|
||||
}
|
||||
|
||||
// Add the invite event to the roomserver.
|
||||
err = api.SendInvite(
|
||||
|
@ -185,12 +178,12 @@ func processInvite(
|
|||
if isInviteV2 {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
JSON: gomatrixserverlib.RespInviteV2{Event: signedEvent},
|
||||
JSON: gomatrixserverlib.RespInviteV2{Event: &signedEvent},
|
||||
}
|
||||
} else {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
JSON: gomatrixserverlib.RespInvite{Event: signedEvent},
|
||||
JSON: gomatrixserverlib.RespInvite{Event: &signedEvent},
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -296,15 +296,11 @@ func attemptMakeJoinForRestrictedMembership(
|
|||
// other servers can use to verify that the user we put into the
|
||||
// `join_authorised_via_users_server` field was actually checked
|
||||
// and found by us.
|
||||
signed, err := event.Sign(string(cfg.Matrix.ServerName), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey)
|
||||
if err != nil {
|
||||
logger.WithError(err).Error("Failed to sign event")
|
||||
return jsonerror.InternalServerError()
|
||||
}
|
||||
signed := event.Sign(string(cfg.Matrix.ServerName), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey)
|
||||
|
||||
// Now, see if the join is valid with the new changes. If it isn't
|
||||
// then something else is forbidding the join.
|
||||
if err = gomatrixserverlib.Allowed(signed, &provider); err != nil {
|
||||
if err = gomatrixserverlib.Allowed(&signed, &provider); err != nil {
|
||||
logger.WithError(err).Error("Join is not allowed")
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusForbidden,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue