The libsignal-based connections now have all dependencies passed in
explicitly; the classic and shadowing connections still have a few
GlobalDependencies, but those classes will be eliminated altogether in
the long term.
Includes code changes for libsignal splitting ChatService into
AuthenticatedChatService and UnauthenticatedChatService, which is more
in line with how iOS does things anyway. Also now supports receiving
stories on the auth connection using libsignal.
This is a *subclass* of OWSChatConnectionUsingLibSignal, mainly
because the authenticated/identified connection really does have
capabilities the unauth/unidentified one does not, and splitting those
out makes it easier to see which are which.
For now each websocket connection, identified and unidentified, has
its own libsignal ChatService instance, even though ChatService is
designed to manage both connections together. Later on in the
migration it'll make sense to consolidate them, but under the existing
structure of OWSChatConnection this is the easiest way to manage their
lifecycles.
Controlled by new RemoteConfig flag
"ios.experimentalTransportEnabled.libsignalAuth" (and for local
testing, UserDefaults flag UseLibsignalForIdentifiedWebsocket).
The choice of whether or not to use this is controlled by a
RemoteConfig flag, ios.experimentalTransportEnabled.libsignal, but
because ChatConnectionManager is set up before RemoteConfig has even
loaded its cached settings, the flag is cached in UserDefaults, like
the shadowing kill switch setting.