mirror of
https://github.com/1f349/dendrite.git
synced 2024-12-26 01:56:39 +00:00
Don't return nonsense canonical room aliases in the public rooms responses (#1992)
This commit is contained in:
parent
2dd5fd1fd6
commit
51b119107c
@ -156,7 +156,9 @@ func fillInRooms(ctx context.Context, roomIDs []string, rsAPI roomserverAPI.Room
|
||||
case topicTuple:
|
||||
pub.Topic = contentVal
|
||||
case canonicalTuple:
|
||||
pub.CanonicalAlias = contentVal
|
||||
if _, _, err := gomatrixserverlib.SplitID('#', contentVal); err == nil {
|
||||
pub.CanonicalAlias = contentVal
|
||||
}
|
||||
case visibilityTuple:
|
||||
pub.WorldReadable = contentVal == "world_readable"
|
||||
// need both of these to determine whether guests can join
|
||||
|
@ -215,7 +215,9 @@ func PopulatePublicRooms(ctx context.Context, roomIDs []string, rsAPI Roomserver
|
||||
case topicTuple:
|
||||
pub.Topic = contentVal
|
||||
case canonicalTuple:
|
||||
pub.CanonicalAlias = contentVal
|
||||
if _, _, err := gomatrixserverlib.SplitID('#', contentVal); err == nil {
|
||||
pub.CanonicalAlias = contentVal
|
||||
}
|
||||
case visibilityTuple:
|
||||
pub.WorldReadable = contentVal == "world_readable"
|
||||
// need both of these to determine whether guests can join
|
||||
|
Loading…
Reference in New Issue
Block a user