This logic was similar between platforms, and it makes sense to keep it in a single place. It becomes even more important now, because invite link blobs handling will complicate it by a lot, and we should avoid maintaining it in two places.
Depends on D10338