Use hungryserv room yeeting endpoint

This commit is contained in:
Tulir Asokan 2023-01-04 12:48:16 +02:00
parent c42b1f1e93
commit bbabf389a5

View file

@ -4386,6 +4386,13 @@ func (portal *Portal) Cleanup(puppetsOnly bool) {
return return
} }
intent := portal.MainIntent() intent := portal.MainIntent()
if portal.bridge.SpecVersions.UnstableFeatures["com.beeper.room_yeeting"] {
err := intent.BeeperDeleteRoom(portal.MXID)
if err == nil || errors.Is(err, mautrix.MNotFound) {
return
}
portal.log.Warnfln("Failed to delete %s using hungryserv yeet endpoint, falling back to normal behavior: %v", portal.MXID, err)
}
members, err := intent.JoinedMembers(portal.MXID) members, err := intent.JoinedMembers(portal.MXID)
if err != nil { if err != nil {
portal.log.Errorln("Failed to get portal members for cleanup:", err) portal.log.Errorln("Failed to get portal members for cleanup:", err)