mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Simplify
This commit is contained in:
parent
1607b8ef78
commit
f6b68b4c4b
1 changed files with 1 additions and 4 deletions
|
@ -483,14 +483,12 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma
|
||||||
return t.servers
|
return t.servers
|
||||||
}
|
}
|
||||||
dedupe := map[gomatrixserverlib.ServerName]struct{}{}
|
dedupe := map[gomatrixserverlib.ServerName]struct{}{}
|
||||||
count := 1
|
|
||||||
t.servers = []gomatrixserverlib.ServerName{t.Origin} // transaction origin
|
t.servers = []gomatrixserverlib.ServerName{t.Origin} // transaction origin
|
||||||
dedupe[t.Origin] = struct{}{}
|
dedupe[t.Origin] = struct{}{}
|
||||||
if eventOrigin != "" {
|
if eventOrigin != "" {
|
||||||
if _, ok := dedupe[eventOrigin]; !ok {
|
if _, ok := dedupe[eventOrigin]; !ok {
|
||||||
t.servers = append(t.servers, eventOrigin) // event origin, if specified
|
t.servers = append(t.servers, eventOrigin) // event origin, if specified
|
||||||
dedupe[eventOrigin] = struct{}{}
|
dedupe[eventOrigin] = struct{}{}
|
||||||
count++
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
serverReq := &api.QueryServerJoinedToRoomRequest{
|
serverReq := &api.QueryServerJoinedToRoomRequest{
|
||||||
|
@ -502,8 +500,7 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma
|
||||||
if _, ok := dedupe[server]; !ok {
|
if _, ok := dedupe[server]; !ok {
|
||||||
t.servers = append(t.servers, server)
|
t.servers = append(t.servers, server)
|
||||||
dedupe[server] = struct{}{}
|
dedupe[server] = struct{}{}
|
||||||
count++
|
if len(t.servers) == 10 {
|
||||||
if count == 10 {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue