Incorporates ideas from https://github.com/matrix-org/matrix-react-sdk/pull/6198
Signed-off-by: Robin Townsend <robin@robin.town>