This builds out infrastructure to fetch updated PeekInfo structs from
RingRTC on a GroupCallUpdate. There are still a bunch of TODOs to
resolve once RingRTC adds PeekInfo.
* user can add custom notification sounds from Files app (aiff, wav, or caf files)
* former OWSSound enum is now named OWSStandardSound, OWSSound turned into an alias for NSUInteger
* custom sounds get IDs based on the hash of the file name
- Removes ContactsUpdater singleton. It wasn't really tracking much
state anyway
- Introduces ContactDiscoveryTask. This creates a
ContactDiscoveryOperation (modern or legacy) and updates the
SignalRecipients database on completion. Returns a promise.
- Begin migrating away from operation queues
PromiseKit is weird about priority propogation, so this shouldn't be
used yet. Since all then closures are asynced, priorities don't
propogate down to underlying queues. This means the a
ContactDiscoveryTask on the main queue will not boost the priority on
the ModernContactDiscoverOperation's owned operation queue
Creates a new root singleton: OWSMessagePipelineSupervisor
As of right now, this singleton has two responsibilities:
- Track all message processing pipeline stages that have registered
themselves
- Post processing suspension updates to interested stages
Four classes will now register themselves as pipeline stages:
- OWSMessageContentQueue
- YAPDBMessageDecryptQueue
- IncomingGroupsV2MessageQueue
- SSKMessageDecryptJobQueue
At initialization, OWSMessagePipelineSupervisor will take out a pipeline
suspension while it waits for a UUIDBackfillTask to complete. Other
interested objects are also able to suspend the message processing
pipeline by invoking suspendMessageProcessing(for:) on the supervisor
(though, currently this is not used by anything except tests)
This also adds some supporting improvements to UnfairLock. Now,
UnfairLock closures will return the value returned from its critical
section closure.
Added a new field destinationDeviceId to the protocol buffer for
CallMessage.
Added supporting logic of setting it when sending.
Added a catch when receiving: If the field is defined, then use it
and check the local deviceId and if not a match, drop the message
since it is not for this device.
Changed naming to be more explicit.
Removed the FeatureLevel definition from the protocol since proto enums
won't be backwards compatible if updated. Instead, adding boolean flags
instead. For this release, the feature supported is multi-ring, so a
multiRing flag is defined instead of a feature level.
The supportsMultiRing value is persisted through to RingRTC. There is
no more need to translate between the enumerations anymore.
Added prefix naming for proto enums since the namespace is shared.
Removed defaults since they are already the desired default values.
When sending messages, using a nullable unsigned integer type instead
of a flag and value pair. This simplifies the function calls, although
some NSNumber extensions were required on the Swift side.
Add type for Hangup messages, to reflect either normal hangup or hangup
because the call was accepted elsewhere.
Add type to Offer messages, which is used to indicate the type of call
that is being originated, either an audio call (the same as all legacy
calls) or a video call.
Add level for all messages, which is used to filter feature support,
either legacy or multi-ring behavior.
If the feature level for the Call Message is detected as legacy, AND if
the device is NOT the primary, drop the incoming Call Message.
Always mark outgoing Call Messages as multi-ring capable.
Adjust RingRTC interfaces to support:
- Call Media Type (default is always audioCall for now)
- The Hangup Type, which can be either normal (i.e. regular hangup) or
accepted, replacing the removed Accepted message.
Hangups can now be sent out as a legacy messages or new messages. The
format is the same so that legacy clients will ignore 'new' hangups
sent to squelch ringing if they were actually the 'winner'.
Passing information for receivedOffer and receivedAnswer APIs to
indicate if the sender is a legacy sender or not. Legacy here means
someone using the protocol before the FeatureLevel was added to the
prototol for Call Messages.
Passing information to receivedOffer to indicate if the local device
is primary or not. As a result, if the device is receiving the offer
from a legacy device and is non-primary, the offer shall be ignored.
In this case, a new event is fired:
endedIgnoreCallsFromNonMultiringCallers
Co-authored-by: Michael Kirk <michael@signal.org>