diff options
Diffstat (limited to 'clientapi/routing/aliases.go')
-rw-r--r-- | clientapi/routing/aliases.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clientapi/routing/aliases.go b/clientapi/routing/aliases.go index 90621daf..5c2df79d 100644 --- a/clientapi/routing/aliases.go +++ b/clientapi/routing/aliases.go @@ -15,6 +15,7 @@ package routing import ( + "encoding/json" "fmt" "net/http" @@ -48,11 +49,12 @@ func GetAliases( visibility := gomatrixserverlib.HistoryVisibilityInvited if historyVisEvent, ok := stateRes.StateEvents[stateTuple]; ok { var err error - visibility, err = historyVisEvent.HistoryVisibility() - if err != nil { + var content gomatrixserverlib.HistoryVisibilityContent + if err = json.Unmarshal(historyVisEvent.Content(), &content); err != nil { util.GetLogger(req.Context()).WithError(err).Error("historyVisEvent.HistoryVisibility failed") return util.ErrorResponse(fmt.Errorf("historyVisEvent.HistoryVisibility: %w", err)) } + visibility = content.HistoryVisibility } if visibility != spec.WorldReadable { queryReq := api.QueryMembershipForUserRequest{ |