Add option to resend bridge info to all portals

This commit is contained in:
Tulir Asokan
2020-06-15 20:28:04 +03:00
parent 8bcf81879d
commit 59e2015fa7
6 changed files with 30 additions and 1 deletions

View File

@@ -835,6 +835,11 @@ func (portal *Portal) getBridgeInfo() (string, event.Content) {
}
func (portal *Portal) UpdateBridgeInfo() {
if len(portal.MXID) == 0 {
portal.log.Debugln("Not updating bridge info: no Matrix room created")
return
}
portal.log.Debugln("Updating bridge info...")
stateKey, content := portal.getBridgeInfo()
_, err := portal.MainIntent().SendStateEvent(portal.MXID, StateBridgeInfo, stateKey, content)
if err != nil {