bridgev2/portal: fix getting state events in roomIsPublic
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

This commit is contained in:
Tulir Asokan 2025-11-21 16:07:16 +02:00
commit 75d54132ae

View file

@ -4295,7 +4295,11 @@ func looksDirectlyJoinable(rule *event.JoinRulesEventContent) bool {
}
func (portal *Portal) roomIsPublic(ctx context.Context) bool {
evt, err := portal.Bridge.Matrix.(MatrixConnectorWithArbitraryRoomState).GetStateEvent(ctx, portal.MXID, event.StateJoinRules, "")
mx, ok := portal.Bridge.Matrix.(MatrixConnectorWithArbitraryRoomState)
if !ok {
return false
}
evt, err := mx.GetStateEvent(ctx, portal.MXID, event.StateJoinRules, "")
if err != nil {
zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to get join rules to check if room is public")
return false