Commit Graph

1073 Commits

Author SHA1 Message Date
Jordan Rose
39a338aa21 Group calls: separate new/existing member safety number notifications
We've been presenting all safety number mismatches as "someone joined
the call you were already in", but sometimes they were in the call
first. In that case, we should use a different message.

While here, make these messages a little more concise so we can fit in
an explicit "Tap to view", to encourage people to come back to the app
and decide whether they want to stay in the call.
2022-11-14 10:01:04 -08:00
Sasha Weiss
242dfd2bce
Add all JobQueues to environment, via a wrapper
Currently, only some `JobQueue` types are initialized during startup
(as part of `Environment`, or `SSKEnvironment`). Initialization is
required, however, for a `JobQueue` type to restart any latent jobs.
That means that, for example, a durable `SendGiftBadge` job that failed,
and should be reattempted at a later date, will not in fact be restarted
since no `SendGiftBadgeJobQueue` will be initialized at launch.

This change adds `SSKJobQueues` and `SignalMessagingJobQueues` types,
which are intended to be singletons that hold within them a singleton
job queue for each of our `JobQueue` types. These wrappers are added to
`SSKEnvironment` and `Environment` (from SignalMessaging) respectively,
ensuring that all the `JobQueue`s they contain are initialized as part
of environment setup. The wrappers also avoid the need to add a new
property to the (already large) environment types for each new future
`JobQueue`.

This change also updates all existing call sites that accessed a
`JobQueue` from an environment object, to direct that access now through
the wrapper type.
2022-11-09 14:08:44 -06:00
Igor Solomennikov
6a7d6c0fae
Switify some code related to ConversationInputToolbar.
* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
2022-11-07 16:32:59 -08:00
Jordan Rose
a87651e7ed Handle incoming group call rings
This adds a table of "cancelled group rings", to handle out-of-order
delivery between a cancellation and a ring. (This can happen when the
cancellation comes from a linked device rather than the original
ringer, though it's very unlikely.) Thirty-minute-old cancellations
are cleared lazily.

This also adds a new IncomingCallControls to replace the usual
CallControls in a GroupCallViewController.

And finally, there's a lot of code that was 1:1-call-specific that now
handles group calls as well, either by being more general or by
checking which kind of call we have.
2022-11-07 09:48:53 -08:00
Harry
793a1cee45
Add accessibilityLabel to items in PhotoLibrary
* Refactor PhotoGridItem to be more compile-time safe

* Add accessibilityLabel to items in PhotoLibrary

* run auto genstrings

* fix build issue

Co-authored-by: Meher Kasam <meheranandk@gmail.com>
2022-11-01 10:46:33 -07:00
Harry
4a955ade9d
Various fixes related to enabling/disabling stories
* Don't donate share intests for outgoing story group replies

* Properly hide tab bar when using reduced transparency setting
2022-10-13 08:33:13 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
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
2022-10-13 08:25:37 -05:00
Jordan Rose
bd264b462f Use rich intents whenever possible
For certain kinds of notifications, we attach "intents" to let the
system know who's contacting us (for use in, say, share sheet
suggestions; controlled by Settings > Chats > Share Contacts with
iOS). Previously we only provided "rich" intents on iOS 15 and a
minimal implementation for iOS 13, but even if iOS 13 won't do as much
with the information we can be more consistent.
2022-09-23 15:50:33 -07:00
Sasha Weiss
32b88948e8
Clear story messages before attachments 2022-09-23 11:52:46 -07:00
Sasha Weiss
121161e212
Clear StoryMessage instances when clearing all chat history 2022-09-22 15:22:52 -07:00
Michelle Linington
4ada6b3a3f Derive bundle ID from an Xcode build setting
See [#5423][5423].

[5423]: https://github.com/signalapp/Signal-iOS/pull/5423
2022-09-21 18:10:42 +00:00
Nora Trapp
01e06e50a6 Don't record send message intents for stories 2022-09-16 11:28:34 -07:00
Nora Trapp
6b21e2c887 Add 'Views off' state to stories 2022-09-12 10:42:09 -07:00
Nora Trapp
de0ef9444b Fix some usage of NSLocalizedString 2022-09-11 10:36:23 -07:00
Nora Trapp
73316f2420 Notify for replies to group stories 2022-09-08 17:12:24 -07:00
Sasha Weiss
4085771309
Centralize force-casts in a VersionedProfilesSwift dependency 2022-09-07 12:43:09 -07:00
Sasha Weiss
4d099bc53f
Show 3 digits of UUIDs in logs 2022-09-01 17:48:59 -07:00
Harry
8ab9505d75
Ignore failures to clean up dotfiles in logs directory on simulators 2022-08-25 16:24:19 -07:00
Jordan Rose
094c8290ce Remove unnecessary NotificationCenter.removeObserver calls
As of iOS 9, selector-based observers in NotificationCenter do not
need to be explicitly unregistered.
2022-08-02 17:43:52 -07:00
Jordan Rose
4f06a6d8a5 Fix incorrect uses of NotificationCenter block-based API
The block-based API returns a token that needs to be explicitly
unregistered, *and* the block should not capture 'self' strongly.
The fixes in this PR come in three flavors:

1. Switch to the selector-based API, sometimes taking advantage of
   the fact that extra arguments to an Objective-C method can be
   safely discarded (because they are passed at +0).

2. Save the observer token and unregister in deinit.

3. Comment why it's safe to leave the observer registered forever
   in this particular case.
2022-08-02 17:43:52 -07:00
Nora Trapp
7a84d7605b Allow viewing your own sent stories 2022-08-01 12:44:31 -07:00
Evan Hahn
7480e5c015 Change default for "notify when contact joined Signal"
Also reorders imports, per the precommit script.
2022-07-27 16:58:06 -05:00
Nora Trapp
b67069e251 Add the editing of private stories 2022-07-15 15:05:03 -07:00
Evan Hahn
57c47ced2c Fix operator_whitespace SwiftLint violations
This fixes violations of [SwiftLint's `operator_whitespace` rule][0].
This is a whitespace-only change.

[0]: https://realm.github.io/SwiftLint/operator_whitespace.html
2022-07-07 17:38:38 -07:00
Max Radermacher
f7f66d6436
Add support for redeeming gift badges 2022-07-01 14:07:24 -07:00
Max Radermacher
e79f37cc01 Prefer disappearingMessagesDuration(…)
The behavior is the same, and this avoids repeating the same code.
2022-06-22 08:10:55 -07:00
Nora Trapp
7bd167f815
Initial story sending support
* Little fix for context menu

* Add 'My Stories' section to stories tab

* Add new story thread types

* Show stories in conversation picker

* Support for sending stories

* Update story list when sending stories

* Add basic 'My Stories' view controller

* Initial stories settings screens

* Consolidate TSPrivateStoryThread and TSMyStoryThread into one class

* Require an explicit read transaction to initialize an outgoing message

* Fix linting

* Allow enabling group story from internal settings

* Fix tests

* PR Feedback
2022-06-10 22:28:03 -04:00
Evan Hahn
4c0e511793 Fix typos in localization string comments
I noticed a few typos in localization string comments while working on
c5bdf6c094. This fixes those.

This should have no (direct) user impact.
2022-05-16 12:26:31 -05:00
Evan Hahn
29c0ddf60e Fix violations of SwiftLint's attributes rule
_I recommend reviewing this with whitespace changes disabled._

Most of these were `@objc` being on the same line, which I fixed with [a
silly script][1]—probably could've used `sed` if I were wiser. The rest
were manual fixes.

See [the SwiftLint documentation for this rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
[1]: https://gist.github.com/EvanHahn-Signal/d353c93fa269c82b96baca0a1086521f
2022-05-14 09:07:42 -05:00
Evan Hahn
929aae46eb Simplify Searcher#matches
`Searcher`'s `matches` method needed a little cleanup. It iterated over
a collection twice, when it could do with only iterating once (and could
return early).

This fixes that, which also fixes a violation of [Swiftlint's
`reduce_boolean` rule][0].

[0]: https://realm.github.io/SwiftLint/reduce_boolean.html
2022-04-29 12:56:54 -05:00
Martin Böttcher
54b743de2d
moved older stringsdict changes into new branch; minor changes (#4205)
moved older stringsdict changes into new branch
2022-04-28 17:41:43 +02:00
Evan Hahn
9e59ca31b5 Remove redundant DateFormatter locales
The [`locale` property of `DateFormatter`][0] defaults to `.current`, so
we don't need to specify it.

Tested this in English and Spanish in a simulator. Date formats appeared
localized.

[0]: https://developer.apple.com/documentation/foundation/dateformatter/1411973-locale
2022-04-19 09:27:54 -05:00
Michelle Linington
c21b7dc6ee Update min version. Last completed version stores a 3-version 2022-04-14 18:04:16 -07:00
Michelle Linington
460bce289e PR Feedback: Use existing lastLaunchVersion key 2022-04-14 18:04:16 -07:00
Michelle Linington
488259d5ef Lint 2022-04-14 16:25:33 -07:00
Michelle Linington
c19fa8b950 Improve log cleanup on launch 2022-04-14 16:23:21 -07:00
Michelle Linington
f222c2f3e2 Lint 2022-04-11 16:30:55 -07:00
Michelle Linington
5b7a06b642 Adjust logging behavior 2022-04-11 16:30:55 -07:00
Jordan Rose
0a982ebc83 Include timestamp in missed call notifications
...if the call was more than five minutes ago. This should help in two
scenarios:

- you've been offline for a while, and you see "missed call" but don't
  know when they tried to call

- you hit that NSE bug where a ring gets processed hours or even days
  later, possibly when a second call arrives
2022-04-05 10:48:05 -07:00
Nora Trapp
30dae7fb15 Format all times for stories relatively 2022-03-31 00:40:47 -07:00
Nora Trapp
9494498d70 Add support for sending group replies to stories 2022-03-31 00:34:32 -07:00
Martin Böttcher
462177a0ce
improve cold start app start times (#4079)
deferred some initial load for faster app start
2022-03-29 08:24:55 +02:00
Nora Trapp
00dedae3e0 Fix 1:1 sharing suggestions 2022-03-19 11:41:36 -07:00
Nora Trapp
3ce037b57b Prevent story attachments from getting inadvertently pruned by orphan data cleaner 2022-03-17 14:30:21 -07:00
Nora Trapp
d87fa8c16c Add new fonts for text stories 2022-03-17 14:30:19 -07:00
Martin Böttcher
000c4c282b Merge branch 'master' into martin/IOS-2234 2022-03-17 09:09:37 +01:00
Nora Trapp
059dd9a542 Convert TSMention to SDSCodableModel 2022-03-16 18:07:38 -07:00
Nora Trapp
91777d5b9f Convert OWSReaction to SDSCodableModel 2022-03-16 18:06:24 -07:00
Nora Trapp
99350fb38c Rename HomeViewController to ChatListViewController 2022-03-16 17:51:51 -07:00
Martin Böttcher
eedfd70f3e merged master and pod files 2022-03-15 12:49:11 +01:00