mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +00:00
Refactor StoreEvent
and create a new RoomDatabase
interface (#2985)
This PR changes a few things: - It pulls out the creation of several NIDs from the `StoreEvent` function to make the functions more reusable - Uses more caching when using those NIDs to avoid DB round trips
This commit is contained in:
parent
e6aa0955ff
commit
ad07b169b8
31 changed files with 459 additions and 302 deletions
|
@ -194,7 +194,7 @@ func (r *Inviter) PerformInvite(
|
|||
// try and see if the user is allowed to make this invite. We can't do
|
||||
// this for invites coming in over federation - we have to take those on
|
||||
// trust.
|
||||
_, err = helpers.CheckAuthEvents(ctx, r.DB, event, event.AuthEventIDs())
|
||||
_, err = helpers.CheckAuthEvents(ctx, r.DB, info.RoomNID, event, event.AuthEventIDs())
|
||||
if err != nil {
|
||||
logger.WithError(err).WithField("event_id", event.EventID()).WithField("auth_event_ids", event.AuthEventIDs()).Error(
|
||||
"processInviteEvent.checkAuthEvents failed for event",
|
||||
|
@ -291,7 +291,7 @@ func buildInviteStrippedState(
|
|||
for _, stateNID := range stateEntries {
|
||||
stateNIDs = append(stateNIDs, stateNID.EventNID)
|
||||
}
|
||||
stateEvents, err := db.Events(ctx, stateNIDs)
|
||||
stateEvents, err := db.Events(ctx, info.RoomNID, stateNIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue