mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Fix ooops
This commit is contained in:
parent
51bc5f6559
commit
810bcca7f0
|
|
@ -24,9 +24,10 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/roomserver/internal/helpers"
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
"github.com/matrix-org/dendrite/roomserver/internal/helpers"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
|
@ -335,9 +336,9 @@ func (r *Inputer) processRoomEvent(
|
|||
}
|
||||
|
||||
if roomInfo == nil {
|
||||
_, roomInfo, err = r.DB.GetOrCreateRoomNID(ctx, event)
|
||||
roomInfo, err = r.DB.GetOrCreateRoomInfo(ctx, event)
|
||||
if err != nil {
|
||||
return fmt.Errorf("r.DB.GetOrCreateRoomNID: %w", err)
|
||||
return fmt.Errorf("r.DB.GetOrCreateRoomInfo: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,9 +705,9 @@ nextAuthEvent:
|
|||
}
|
||||
|
||||
if roomInfo == nil {
|
||||
_, roomInfo, err = r.DB.GetOrCreateRoomNID(ctx, authEvent)
|
||||
roomInfo, err = r.DB.GetOrCreateRoomInfo(ctx, authEvent)
|
||||
if err != nil {
|
||||
return fmt.Errorf("r.DB.GetOrCreateRoomNID: %w", err)
|
||||
return fmt.Errorf("r.DB.GetOrCreateRoomInfo: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -648,8 +648,7 @@ func (d *Database) IsEventRejected(ctx context.Context, roomNID types.RoomNID, e
|
|||
return d.EventsTable.SelectEventRejected(ctx, nil, roomNID, eventID)
|
||||
}
|
||||
|
||||
// GetOrCreateRoomNID gets or creates a new roomNID for the given event. Also returns a RoomInfo, which is only safe to use
|
||||
// with functions only needing a roomVersion or roomNID.
|
||||
// GetOrCreateRoomInfo gets or creates a new RoomInfo, which is only safe to use with functions only needing a roomVersion or roomNID.
|
||||
func (d *Database) GetOrCreateRoomInfo(ctx context.Context, event *gomatrixserverlib.Event) (roomInfo *types.RoomInfo, err error) {
|
||||
// Get the default room version. If the client doesn't supply a room_version
|
||||
// then we will use our configured default to create the room.
|
||||
|
|
|
|||
Loading…
Reference in a new issue