This avoids an issue where the NSE might decide to wake up the main
app to respond to an Offer, but then the RingRTC in the main app
decides the ring has already expired. We've been careful about
exposing new RingRTC APIs to the NSE because we don't want to dirty
too much memory, but this particular one should be safe.
Change license to AGPL
This commit:
- Updates the `LICENSE` file
- Start every file with something like:
// Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
---
First, I removed existing license headers with this Ruby 3.1.2 script:
require 'set'
EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']
same = 0
different = 0
all_files = `git ls-files`.lines.map { |line| line.strip }
all_files.each do |relative_path|
if relative_path == 'Pods'
next
end
unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
next
end
path = File.expand_path(relative_path)
contents = File.read(path)
new_contents = contents.sub(/\/\/\n\/\/ Copyright .*\n\/\/\n\n/, '')
if contents == new_contents
same += 1
else
different += 1
end
File.write(path, new_contents)
end
puts "updated #{different} file(s), left #{same} untouched"
I'm sure this script could be improved, but it worked well enough.
Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.
Then I fixed some stragglers and updated the precommit script.
See [a similar change in the Desktop app][0].
[0]: 8bfaf598af
Until the main app actually handles these (they are
group-call-ring-related), iOS will think we're trying to abuse the
handoff mechanism to perform non-calling work, and start throttling
relayed messages. Just disable that for now, to be re-enabled soon.
- Move NSE notification waiter to be the very last thing we wait on.
This ensures that notifications enqueued while the message manager
handles messages make it to UserNotifications
- Current call can now be accessed off the main thread
- All group call message handling occurs off the main thread