Commit Graph

1068 Commits

Author SHA1 Message Date
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
Jordan Rose
e8021225a3 Do not load avatar image data in the NSE
Not only should we not build avatars, but even loading the image data
costs us our limited memory space, especially when it's a system
contact avatar whose size we have no control over. Instead, record the
cache key for that avatar in the database.

(Unfortunately, we can't jump to the cache like this in the main app,
because then we'd have no way to check if an avatar has *changed*,
particularly for system contacts.)
2022-03-10 10:32:46 -08:00
Jordan Rose
d7ed13ec63 Fix extension log file deletion
The expression for the relative cutoff timestamp was
`-self.maximumNumberOfLogFiles * kDayInterval`, but
'maximumNumberOfLogFiles' is an unsigned integer, so this turned into
"some day very far in the future" and immediately deleted all
extension logs. The new expression, `self.maximumNumberOfLogFiles *
-kDayInterval` works because 'kDayInterval' is an NSTimeInterval, a
floating-point value.
2022-03-08 16:24:29 -08:00
Martin Böttcher
8f9be31ba3 replaced NSLocalizedStringFromAppBundle with OWSLocalizedString 2022-03-08 10:17:25 +01:00
Martin Böttcher
c0adfbfb32 NSLocalizedString is replaced by NSLocalizedStringFromAppBundle (reading strings from the bundle of the main app) for all source files called by an app extension and the localizable files are removed for the app extension targets. 2022-03-07 13:29:06 +01:00
Michelle Linington
259cf01376 Lint 2022-03-04 14:16:29 -08:00