When using the getProfileFromUserId with getFromRooms == true, it would always fail to load any profile from the database. This is because by default rooms are partial/not postLoaded, which means no state is in memory. However we usually also don't want to load all members in all rooms just to have a usable offline behaviour.
So this changes the function to first check the non-partial rooms. If none of them have the profile, it then starts looking for the specific user profile in the partial rooms. This should only load one member event, which hopefully is faster than loading all members in all rooms.
When using the getProfileFromUserId with getFromRooms == true, it would always fail to load any profile from the database. This is because by default rooms are partial/not postLoaded, which means no state is in memory. However we usually also don't want to load all members in all rooms just to have a usable offline behaviour.
So this changes the function to first check the non-partial rooms. If none of them have the profile, it then starts looking for the specific user profile in the partial rooms. This should only load one member event, which hopefully is faster than loading all members in all rooms.