mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 19:51:39 +00:00
gb vendor update github.com/matrix-org/gomatrixserverlib
This commit is contained in:
parent
ac66d07177
commit
812fdbe22a
2
vendor/manifest
vendored
2
vendor/manifest
vendored
@ -92,7 +92,7 @@
|
|||||||
{
|
{
|
||||||
"importpath": "github.com/matrix-org/gomatrixserverlib",
|
"importpath": "github.com/matrix-org/gomatrixserverlib",
|
||||||
"repository": "https://github.com/matrix-org/gomatrixserverlib",
|
"repository": "https://github.com/matrix-org/gomatrixserverlib",
|
||||||
"revision": "131b3e83fe053bc40f6909226b8c3c1d186799c1",
|
"revision": "775bc0b4341689c9fbb573008c3095495738f092",
|
||||||
"branch": "master"
|
"branch": "master"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,8 @@ import (
|
|||||||
// and works out which event should be used for each state event.
|
// and works out which event should be used for each state event.
|
||||||
func ResolveStateConflicts(conflicted []Event, authEvents []Event) []Event {
|
func ResolveStateConflicts(conflicted []Event, authEvents []Event) []Event {
|
||||||
var r stateResolver
|
var r stateResolver
|
||||||
|
r.resolvedThirdPartyInvites = map[string]*Event{}
|
||||||
|
r.resolvedMembers = map[string]*Event{}
|
||||||
// Group the conflicted events by type and state key.
|
// Group the conflicted events by type and state key.
|
||||||
r.addConflicted(conflicted)
|
r.addConflicted(conflicted)
|
||||||
// Add the unconflicted auth events needed for auth checks.
|
// Add the unconflicted auth events needed for auth checks.
|
||||||
@ -124,6 +126,7 @@ func (r *stateResolver) addConflicted(events []Event) {
|
|||||||
// new block to the block list.
|
// new block to the block list.
|
||||||
offset = len(*blockList)
|
offset = len(*blockList)
|
||||||
*blockList = append(*blockList, nil)
|
*blockList = append(*blockList, nil)
|
||||||
|
offsets[key] = offset
|
||||||
}
|
}
|
||||||
// Get the address of the block in the block list.
|
// Get the address of the block in the block list.
|
||||||
block := &(*blockList)[offset]
|
block := &(*blockList)[offset]
|
||||||
@ -187,6 +190,9 @@ func (r *stateResolver) removeAuthEvent(eventType, stateKey string) {
|
|||||||
func (r *stateResolver) resolveAndAddAuthBlocks(blocks [][]Event) {
|
func (r *stateResolver) resolveAndAddAuthBlocks(blocks [][]Event) {
|
||||||
start := len(r.result)
|
start := len(r.result)
|
||||||
for _, block := range blocks {
|
for _, block := range blocks {
|
||||||
|
if len(block) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if event := r.resolveAuthBlock(block); event != nil {
|
if event := r.resolveAuthBlock(block); event != nil {
|
||||||
r.result = append(r.result, *event)
|
r.result = append(r.result, *event)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user