mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Add comments to ResolveConflictsAdhoc
This commit is contained in:
parent
3c09885488
commit
5b38d555c4
|
|
@ -681,6 +681,12 @@ func (v StateResolution) calculateStateAfterManyEvents(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResolveConflictsAdhoc is a helper function to assist the query API in
|
||||||
|
// performing state resolution when requested. This is a different code
|
||||||
|
// path to the rest of state.go because this assumes you already have
|
||||||
|
// gomatrixserverlib.Event objects and not just a bunch of NIDs like
|
||||||
|
// elsewhere in the state resolution.
|
||||||
|
// TODO: Some of this can possibly be deduplicated
|
||||||
func ResolveConflictsAdhoc(
|
func ResolveConflictsAdhoc(
|
||||||
version gomatrixserverlib.RoomVersion,
|
version gomatrixserverlib.RoomVersion,
|
||||||
events []gomatrixserverlib.Event,
|
events []gomatrixserverlib.Event,
|
||||||
|
|
@ -720,6 +726,7 @@ func ResolveConflictsAdhoc(
|
||||||
resolved = gomatrixserverlib.ResolveStateConflicts(conflicted, authEvents)
|
resolved = gomatrixserverlib.ResolveStateConflicts(conflicted, authEvents)
|
||||||
resolved = append(resolved, notConflicted...)
|
resolved = append(resolved, notConflicted...)
|
||||||
case gomatrixserverlib.StateResV2:
|
case gomatrixserverlib.StateResV2:
|
||||||
|
// TODO: auth difference here?
|
||||||
resolved = gomatrixserverlib.ResolveStateConflictsV2(conflicted, notConflicted, authEvents, authEvents)
|
resolved = gomatrixserverlib.ResolveStateConflictsV2(conflicted, notConflicted, authEvents, authEvents)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unsupported state resolution algorithm")
|
return nil, errors.New("unsupported state resolution algorithm")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue