mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-09 07:03:10 -06:00
Try that again
This commit is contained in:
parent
69b9d3ba00
commit
13ce67ecfe
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue