NewsCrawler.org

Showing a random profile bio in Matrix, and how the approach changed

A screenshot of a biography of mine, stylised with lots of colours in the text
Image: nexy.blog

The author has over 25 bios on their Matrix profile, and they rotate, so someone who asks about one of them may have seen a different one. The bio field comes from MSC4440[1], an unstable proposal that clients such as Gomuks, Sable and Commet support, and it uses extensible profiles from MSC4133.

Profiles are static, so the author first intercepted profile requests on their own homeserver[2] and returned a random entry from a list built into the code. In the second version, the list was stored in the profile itself and a random entry was chosen when the profile was built, so the author's own client also showed a random bio. This ran into the 64KiB limit on profiles, and the whole list was copied into every profile that other servers downloaded.

The third version moves the list to account data[3], which Matrix uses to store client settings such as push rules and the ignored user list.

Read the original nexy.blogDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page