mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Tweaks
This commit is contained in:
parent
8cd5fd4849
commit
645e3f5833
2 changed files with 11 additions and 2 deletions
|
@ -37,6 +37,7 @@ type RoomserverInternalAPI struct {
|
|||
Cache caching.RoomServerCaches
|
||||
ServerName gomatrixserverlib.ServerName
|
||||
KeyRing gomatrixserverlib.JSONVerifier
|
||||
ACLs *acls.ServerACLs
|
||||
fsAPI fsAPI.FederationInternalAPI
|
||||
asAPI asAPI.AppServiceQueryAPI
|
||||
OutputRoomEventTopic string // Kafka topic for new output room events
|
||||
|
@ -55,6 +56,8 @@ func NewRoomserverAPI(
|
|||
Cache: caches,
|
||||
ServerName: cfg.Matrix.ServerName,
|
||||
PerspectiveServerNames: perspectiveServerNames,
|
||||
ACLs: serverACLs,
|
||||
Producer: producer,
|
||||
Queryer: &query.Queryer{
|
||||
DB: roomserverDB,
|
||||
Cache: caches,
|
||||
|
|
|
@ -116,8 +116,8 @@ func (r *Inputer) processRoomEvent(
|
|||
|
||||
// Then check if the prev events are known, which we need in order
|
||||
// to calculate the state before the event.
|
||||
if err := r.checkForMissingAuthEvents(ctx, input); err != nil {
|
||||
return "", fmt.Errorf("r.checkForMissingAuthEvents: %w", err)
|
||||
if err := r.checkForMissingPrevEvents(ctx, input); err != nil {
|
||||
return "", fmt.Errorf("r.checkForMissingPrevEvents: %w", err)
|
||||
}
|
||||
|
||||
var softfail bool
|
||||
|
@ -251,11 +251,15 @@ func (r *Inputer) checkForMissingAuthEvents(
|
|||
return nil
|
||||
}
|
||||
|
||||
logrus.Printf("XXX: Auth event IDs: %+v", authEventIDs)
|
||||
|
||||
knownAuthEventNIDs, err := r.DB.EventNIDs(ctx, authEventIDs)
|
||||
if err != nil {
|
||||
return fmt.Errorf("r.DB.EventNIDs: %w", err)
|
||||
}
|
||||
|
||||
logrus.Printf("XXX: Known auth event IDs: %+v", knownAuthEventNIDs)
|
||||
|
||||
missingAuthEventIDs := make([]string, 0, len(authEventIDs)-len(knownAuthEventNIDs))
|
||||
for _, authEventID := range authEventIDs {
|
||||
if _, ok := knownAuthEventNIDs[authEventID]; !ok {
|
||||
|
@ -263,6 +267,8 @@ func (r *Inputer) checkForMissingAuthEvents(
|
|||
}
|
||||
}
|
||||
|
||||
logrus.Printf("XXX: Missing auth event IDs: %+v", missingAuthEventIDs)
|
||||
|
||||
if len(missingAuthEventIDs) > 0 {
|
||||
req := &fedapi.QueryEventAuthFromFederationRequest{
|
||||
RoomID: input.Event.RoomID(),
|
||||
|
|
Loading…
Reference in a new issue