This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise for 2 person rooms, which should be 99% of cases
Performing a virtual user -> native user lookup is rather expensive. It requires making a third-party lookup API call in the background. We would rather not need to do so every time a call comes in. Translating a virtual room to a native room is rather cheap in contrast - the client already knows about it. Thus, we can make an optimisation by checking if the corresponding native room has only two users in it. If so, we can likely assume that whichever user in the native that's not us, is probably the same user that calls us via the virtual room. Thus in that case, we just return that user's profile information.
- Loading branch information
1 parent
072874c
commit 04505b7
Showing
1 changed file
with
41 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters