Commit Graph

8172 Commits

Author SHA1 Message Date
Nora Trapp
023a83bb60 Ensure story view receipts are sent even if read receipts are disabled 2022-10-24 15:28:21 -07:00
Nora Trapp
8cc1a310eb
Filter story info and views sheets based on context 2022-10-24 15:28:00 -07:00
Max Radermacher
87aef6d5e5 Remove redundant ";" from method implementations
There’s a warning for this in SignalServiceKit.
2022-10-24 10:30:07 -07:00
Max Radermacher
f27d53deb2 Remove .otherUsersProfileWillChange notification
It’s not used, and it’s misleading because it gets sent *after* the
profile has changed.
2022-10-24 11:31:47 -05:00
Max Radermacher
60f43335d3 Send reactive profile key if we’re both in a group 2022-10-21 16:00:52 -07:00
Max Radermacher
3a782059ff
Clean up attestation verification 2022-10-20 20:52:15 -07:00
Max Radermacher
cf11cccaad
Add INTEL-SA-00615 advisory 2022-10-20 20:17:39 -07:00
Nora Trapp
e86c5b7b3e Don't discard story view receipts if read receipts are disabled 2022-10-20 15:42:44 -07:00
Nora Trapp
62759daa60 Properly handle unregistered recipients during sender key sends 2022-10-20 15:39:05 -07:00
Nora Trapp
13a52912bc Only take state updates from outgoing messages if we're in a transient state 2022-10-20 15:38:28 -07:00
Harry
87db4ab0aa
Better multisend of text stories
* Shuffle code around, adding UnsentTextAttachment

* Replace usages of TextAttachment with UnsentTextAttachment where applicable, creating an actual TextAttachment (and associated OWSlinkPreview image TSAttachment, if applicable) only per-recipient

* Only upload one text story link preview image attachment and propagate it to the individual TSAttachments created for each destination

* update comments so I don't lose my mind the next time I read this code

* Dedupe text stories sent to the same person via multiple private threads

* fix non-compiling tests

* pr feedback
2022-10-20 11:04:25 -07:00
Harry
a0168195f4
Story fixes: context menu and my story row
* remove unecessary owsFailDebug

* fix context menu icon positioning

* fix layout of custom context menus near the left side of the screen in RTL languages

* UX tweaks for my story cell

* status

* apply theme changes to tab bar that happened while it was hidden

* pr feedback 1

* pr feedback 2
2022-10-19 10:48:09 -07:00
Max Radermacher
9db9d94085
Handle isComplete during incoming contact syncs 2022-10-19 09:29:52 -07:00
Max Radermacher
3b11c52177
Move all ContactDiscoveryTask callers to Swift
* Move `intersectContacts:…` to Swift
* Move RecipientPickerVC contact discovery to Swift
* Remove ObjC support from ContactDiscoveryTask
2022-10-19 08:34:50 -07:00
Igor Solomennikov
f7b0c4a339
"Attach Link" UX improvements.
* Fix faulty logic in validation of a URL parsed from string.

`OWSLinkPreview.isPermittedLinkPreviewUrl(parsedFrom:)` has logic to extract
hostname from a string that matches a detected URL. The logic was assuming that
every string begins with a scheme prefix (eg "http://"). That assumption isn't
always correct because NSDataDetector uses HTTP scheme when scheme prefix is not
present (eg "google.com" would result in "http://google.com" being detected).

* Two improvements to "attach link" UX.

• any valid HTTPS url can be attached to a text story, even if the link wouldn't
  actually work.
• show progress indicator while fetching a link preview.

* Add "https://" to address in "attach link preview" UI if necessary.
2022-10-18 18:20:40 -07:00
Harry
9436ee6608
Use read state for the stories tab bar badge
* Use read timestamp in story badge count

* Add StoryBadgeCountManager

* Manager stories tab bar badge count in StoryBadgeCountManager

* Don't mark stories read while the app is backgrounded. Mark them read when foregrounding and on the tab bar

* Only mark the latest story per context as read

* fix tests
2022-10-18 16:22:50 -07:00
Harry
df51a9f837
Story-related conversation picker fixes
* apply theme to cells when conversation picker theme changes

* Retain selection UI when reloading conversation picker cells

* Prioritize newly created story threads for conversation picker sort ordering

* Index private story threads for searching

* Add story search results to conversation picker and fix issues with reloading with stuff pre-selected

* PR feedback 1: efficient thread migration

* PR feedback 2: don't allow expansion of story search results
2022-10-18 16:14:16 -07:00
Max Radermacher
9d8af6aba0 UUIDBackfillTask: Reuse exponential backoff logic 2022-10-18 16:10:10 -07:00
Max Radermacher
cc4af7b88e Remove CDSH 2022-10-18 16:08:33 -07:00
Harry
70780cfc7c
Add read state to the onboarding story
* Add readOnboardingStory to AccountRecord

* Add onboarding story read state to SystemStoryManager

* Sync onboarding story read state with storage service

* fix incorrect delete of unviewed system stories
2022-10-18 15:27:13 -07:00
Nora Trapp
5fc3c033d8 Add ability to set view receipts for stories 2022-10-18 11:23:26 -07:00
Nora Trapp
bb84fd3473 Add new storyViewReceiptsEnabled flag to storage service 2022-10-18 11:23:26 -07:00
Harry
201f002499
Add lastReadTimestamp to StoryContextAssociatedData
* Add last read timestamp to StoryContextAssociatedData

* Write lastReadTimestamp on StoryContextAssociatedData

* Copy lastViewedTimestamp over to lastReadTimestamp to simplify badge query

* apply didSets for data that changed at rest
2022-10-18 11:18:06 -07:00
Harry
49975b2fdc
Add read timestamp to StoryMessage
* Add read timestamp to incoming story manifest

* send story message read syncs to linked devices

* Process incoming story message read syncs from linked devices
2022-10-18 11:15:10 -07:00
Nora Trapp
781444df45 Drop incoming stories from non-admins in announcement groups 2022-10-18 11:09:10 -07:00
Evan Hahn
623b1909b2
Prefer Decimal over NSDecimalNumber
This change should have no user impact.

We use `NSDecimalNumber` and `Decimal`. This tries to standardize on
`Decimal` where possible (though the former is still needed in a few
places).

Mostly a mechanical change, though a few little things changed.
2022-10-18 09:43:46 -05:00
Nora Trapp
8b6cc7a8b7
Don't include group story replies when querying mentions 2022-10-17 23:46:41 -07:00
Nora Trapp
0a2518b16b Only tag SKDMs as story sends for non-group threads 2022-10-17 23:43:06 -07:00
Nora Trapp
2afee76393 Allow enabling stories by country code 2022-10-17 23:42:50 -07:00
Evan Hahn
e757a34e9b Auto-fix licese header violations in precommit script
Also fixes a violation.
2022-10-17 21:08:59 -07:00
Max Radermacher
5af7880c39 Remove redundant checks for the main app
All of these use `runNowOrWhenMainAppDidBecomeReadyAsync`, and that only
runs the block in the main app, so there’s no need to skip the block if
we’re in an extension.
2022-10-17 12:42:42 -07:00
Sasha Weiss
151e8b8044
Migrate from ExperienceUpgradeId to ExperienceUpgradeManifest (#5163) 2022-10-17 09:55:12 -07:00
Evan Hahn
418ac9a836 Fix database corruption startup logging
Before:

    Database corruption state: SignalServiceKit.DatabaseCorruptionState

After:

    Database corruption state: Database is not corrupted. Corruption count: 0
2022-10-17 11:40:08 -05:00
Max Radermacher
66a6b428bb Remove internal-only profile key merging code
This is no longer necessary.
2022-10-17 09:27:55 -07:00
Max Radermacher
307a19de4d Fix warning in SwiftSingletons
When using `_isDebugAssertConfiguration()`, one of the two branches will
always be unused. As a result, the compiler complains about unused code.
By putting the entire check inside `assert`, it’s still executed only
when assertions are enabled, but there’s no longer a warning.

Also, use [`ObjectIdentifier`][0] rather than `String(describing:)` as
it’s a more canonical way to uniquely identify types.

[0]: https://developer.apple.com/documentation/swift/objectidentifier
2022-10-17 09:20:31 -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
Igor Solomennikov
bb9d0edabb
Update text color adjustment behavior in photo editor and text story creation.
• text story composer now has three options: colored text with no background,
colored text on white background, white text on colored background.
• text/background color is switched to black if user chooses background/text
color close to white, to avoid white on white look.
• photo editor has three options from above + white text with colored underline.
2022-10-12 23:19:07 -07:00
Jordan Rose
aeecb19d2a Report group calls to CallKit like we do 1:1 calls 2022-10-12 16:54:17 -07:00
Max Radermacher
9953f99784 Remove unused donation code 2022-10-12 11:30:39 -07:00
Nora Trapp
53f6561543 Enable the stories capability for all linked devices 2022-10-12 11:24:51 -07:00
Sasha Weiss
5adae8a0b7
Copy port when constructing a URL 2022-10-12 11:16:35 -07:00
Harry
823e41496a
Fix group story unread count lookup
* Fix group story unread count lookup

* Use IS instead of = and IS NOT instead of !=
2022-10-12 09:58:21 -07:00
Igor Solomennikov
d4d68e266a
Fix crash with empty WHERE in SQL query 2022-10-12 08:57:06 -05:00
Max Radermacher
d1819186f1
Remove unnecessary tryToEnableGroupsV2 call
The only place we call this in production code ensures that all members
already support gv2. As a result, there’s no reason to try and enable
gv2 -- it’s already enabled by the time we reach this code.

There are a few places in the Debug UI that may be relying on these CDS
lookups. I’ve removed one of them since there are existing “clone as v1”
and “clone as v2” options that do nearly the same thing. In another
case, I’ve dropped a reference to a live, non-test account. The other
places in the Debug UI that use this method either construct invalid
phone numbers that will never pass a CDS lookup, or they explicitly
provide UUIDs, which would exclude them from performing a lookup.
2022-10-11 17:46:52 -07:00
Max Radermacher
3ffa2dca2c
Fix nullability for countryNameFromCountryCode 2022-10-11 17:30:58 -07:00
Max Radermacher
815b3c2e1d Simplify CommonGenerator.e164() 2022-10-11 16:25:19 -07:00
Nora Trapp
0db2f93981 Show story send failures on tab badge 2022-10-11 13:09:51 -07:00
Nora Trapp
0dd56d432c Don't index group story replies for search results 2022-10-11 13:09:51 -07:00
Nora Trapp
b42690c2b7 Avoid eroneous log when receiving an SKDM 2022-10-11 13:09:51 -07:00
Sasha Weiss
f49cb92a6a
Upsert the correct ExperienceUpgrade model 2022-10-11 11:36:34 -07:00