mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +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
|
Cache caching.RoomServerCaches
|
||||||
ServerName gomatrixserverlib.ServerName
|
ServerName gomatrixserverlib.ServerName
|
||||||
KeyRing gomatrixserverlib.JSONVerifier
|
KeyRing gomatrixserverlib.JSONVerifier
|
||||||
|
ACLs *acls.ServerACLs
|
||||||
fsAPI fsAPI.FederationInternalAPI
|
fsAPI fsAPI.FederationInternalAPI
|
||||||
asAPI asAPI.AppServiceQueryAPI
|
asAPI asAPI.AppServiceQueryAPI
|
||||||
OutputRoomEventTopic string // Kafka topic for new output room events
|
OutputRoomEventTopic string // Kafka topic for new output room events
|
||||||
|
@ -55,6 +56,8 @@ func NewRoomserverAPI(
|
||||||
Cache: caches,
|
Cache: caches,
|
||||||
ServerName: cfg.Matrix.ServerName,
|
ServerName: cfg.Matrix.ServerName,
|
||||||
PerspectiveServerNames: perspectiveServerNames,
|
PerspectiveServerNames: perspectiveServerNames,
|
||||||
|
ACLs: serverACLs,
|
||||||
|
Producer: producer,
|
||||||
Queryer: &query.Queryer{
|
Queryer: &query.Queryer{
|
||||||
DB: roomserverDB,
|
DB: roomserverDB,
|
||||||
Cache: caches,
|
Cache: caches,
|
||||||
|
|
|
@ -116,8 +116,8 @@ func (r *Inputer) processRoomEvent(
|
||||||
|
|
||||||
// Then check if the prev events are known, which we need in order
|
// Then check if the prev events are known, which we need in order
|
||||||
// to calculate the state before the event.
|
// to calculate the state before the event.
|
||||||
if err := r.checkForMissingAuthEvents(ctx, input); err != nil {
|
if err := r.checkForMissingPrevEvents(ctx, input); err != nil {
|
||||||
return "", fmt.Errorf("r.checkForMissingAuthEvents: %w", err)
|
return "", fmt.Errorf("r.checkForMissingPrevEvents: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var softfail bool
|
var softfail bool
|
||||||
|
@ -251,11 +251,15 @@ func (r *Inputer) checkForMissingAuthEvents(
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Printf("XXX: Auth event IDs: %+v", authEventIDs)
|
||||||
|
|
||||||
knownAuthEventNIDs, err := r.DB.EventNIDs(ctx, authEventIDs)
|
knownAuthEventNIDs, err := r.DB.EventNIDs(ctx, authEventIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("r.DB.EventNIDs: %w", err)
|
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))
|
missingAuthEventIDs := make([]string, 0, len(authEventIDs)-len(knownAuthEventNIDs))
|
||||||
for _, authEventID := range authEventIDs {
|
for _, authEventID := range authEventIDs {
|
||||||
if _, ok := knownAuthEventNIDs[authEventID]; !ok {
|
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 {
|
if len(missingAuthEventIDs) > 0 {
|
||||||
req := &fedapi.QueryEventAuthFromFederationRequest{
|
req := &fedapi.QueryEventAuthFromFederationRequest{
|
||||||
RoomID: input.Event.RoomID(),
|
RoomID: input.Event.RoomID(),
|
||||||
|
|
Loading…
Reference in a new issue