mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Send tombstone to other servers when upgrading rooms
This commit is contained in:
parent
2cb609c428
commit
0d7020fbaf
1 changed files with 5 additions and 4 deletions
|
@ -111,7 +111,7 @@ func (r *Upgrader) performRoomUpgrade(
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Send the tombstone event to the old room
|
// 5. Send the tombstone event to the old room
|
||||||
if pErr = r.sendHeaderedEvent(ctx, tombstoneEvent); pErr != nil {
|
if pErr = r.sendHeaderedEvent(ctx, tombstoneEvent, string(r.Cfg.Matrix.ServerName)); pErr != nil {
|
||||||
return "", pErr
|
return "", pErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ func (r *Upgrader) restrictOldRoomPowerLevels(ctx context.Context, evTime time.T
|
||||||
return resErr
|
return resErr
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if resErr = r.sendHeaderedEvent(ctx, restrictedPowerLevelsHeadered); resErr != nil {
|
if resErr = r.sendHeaderedEvent(ctx, restrictedPowerLevelsHeadered, api.DoNotSendToOtherServers); resErr != nil {
|
||||||
return resErr
|
return resErr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ func (r *Upgrader) clearOldCanonicalAliasEvent(ctx context.Context, oldRoom *api
|
||||||
return resErr
|
return resErr
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if resErr = r.sendHeaderedEvent(ctx, emptyCanonicalAliasEvent); resErr != nil {
|
if resErr = r.sendHeaderedEvent(ctx, emptyCanonicalAliasEvent, api.DoNotSendToOtherServers); resErr != nil {
|
||||||
return resErr
|
return resErr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -666,13 +666,14 @@ func createTemporaryPowerLevels(powerLevelContent *gomatrixserverlib.PowerLevelC
|
||||||
func (r *Upgrader) sendHeaderedEvent(
|
func (r *Upgrader) sendHeaderedEvent(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
headeredEvent *gomatrixserverlib.HeaderedEvent,
|
headeredEvent *gomatrixserverlib.HeaderedEvent,
|
||||||
|
sendAsServer string,
|
||||||
) *api.PerformError {
|
) *api.PerformError {
|
||||||
var inputs []api.InputRoomEvent
|
var inputs []api.InputRoomEvent
|
||||||
inputs = append(inputs, api.InputRoomEvent{
|
inputs = append(inputs, api.InputRoomEvent{
|
||||||
Kind: api.KindNew,
|
Kind: api.KindNew,
|
||||||
Event: headeredEvent,
|
Event: headeredEvent,
|
||||||
Origin: r.Cfg.Matrix.ServerName,
|
Origin: r.Cfg.Matrix.ServerName,
|
||||||
SendAsServer: api.DoNotSendToOtherServers,
|
SendAsServer: sendAsServer,
|
||||||
})
|
})
|
||||||
if err := api.SendInputRoomEvents(ctx, r.URSAPI, inputs, false); err != nil {
|
if err := api.SendInputRoomEvents(ctx, r.URSAPI, inputs, false); err != nil {
|
||||||
return &api.PerformError{
|
return &api.PerformError{
|
||||||
|
|
Loading…
Reference in a new issue