Since we didn't have a way of identifying if the current login for self-hosted sites was being done from the Jetpack app, the filter for removing Jetpack CP-connected sites was executed, but for the Jetpack app this should never be the case.
This fix introduces a new LoginMode for identifying JETPACK_SELFHOSTED logins, and reuses the existing logic for JETPACK_LOGIN_ONLY for keeping the Jetpack CP-connected sites when fetching all sites.
This is part of the fix for: https://github.com/wordpress-mobile/WordPress-Android/issues/18223
Companion PR: https://github.com/wordpress-mobile/WordPress-Android/pull/18952
Since we didn't have a way of identifying if the current login for self-hosted sites was being done from the Jetpack app, the filter for removing Jetpack CP-connected sites was executed, but for the Jetpack app this should never be the case.
This fix introduces a new
LoginMode
for identifyingJETPACK_SELFHOSTED
logins, and reuses the existing logic forJETPACK_LOGIN_ONLY
for keeping the Jetpack CP-connected sites when fetching all sites.