Try that again

This commit is contained in:
Neil Alexander 2022-08-03 13:09:17 +01:00
parent 69b9d3ba00
commit 13ce67ecfe
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 3 additions and 3 deletions

View file

@ -51,7 +51,7 @@ func SendEventWithState(
origin gomatrixserverlib.ServerName, haveEventIDs map[string]bool, async bool,
) error {
outliers := state.Events(event.RoomVersion)
ires := make([]InputRoomEvent, 0, len(outliers))
ires := make([]InputRoomEvent, 0, len(outliers)+1)
for _, outlier := range outliers {
if haveEventIDs[outlier.EventID()] {
continue

View file

@ -137,7 +137,7 @@ func (r *Inputer) processRoomEvent(
return fmt.Errorf("r.DB.RoomInfo: %w", rerr)
}
isCreateEvent := event.Type() == gomatrixserverlib.MRoomCreate && event.StateKeyEquals("")
if !isCreateEvent && (roomInfo == nil || roomInfo.IsStub()) {
if roomInfo == nil && !isCreateEvent {
return fmt.Errorf("room %s does not exist for event %s", event.RoomID(), event.EventID())
}

View file

@ -157,7 +157,7 @@ func (d *Database) RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo
func (d *Database) roomInfo(ctx context.Context, txn *sql.Tx, roomID string) (*types.RoomInfo, error) {
roomInfo, ok := d.Cache.GetRoomInfo(roomID)
if ok && roomInfo != nil && !roomInfo.IsStub() {
if ok && roomInfo != nil && !roomInfo.IsStub() && roomInfo.RoomNID != 0 {
// The data that's in the cache is not stubby, so return it.
return roomInfo, nil
}