Commit Graph

8184 Commits

Author SHA1 Message Date
Sasha Weiss
bfbdf5b78d
Move system contact names to ContactRecord 2022-10-26 15:00:36 -07:00
Harry
55b34eff11
Pre-release story fixes
* fix story views + replies sheet header update when swiping

* fix my story privacy show more off-by-one

* Disable story sends when hiding a group story. Unhide when enabling story sends to a group story.

* More consistent story tab bar badge offset
2022-10-25 16:19:36 -07:00
Adam Mork
2dd98c37b3
[Payments] Show alert if client is outdated
Co-authored-by: Phil Larson <phil.larson@icloud.com>
Co-authored-by: Max Radermacher <max@signal.org>
2022-10-25 15:43:43 -07:00
Harry
075133be72
Observe story viewed ring changes in ConversationAvatarView
* Observe story viewed ring changes in ConversationAvatarView itself

* Manage ConversationAvatarView's story observation based on the context

* remove story state from thread view model, now unused

* pr feedback renames
2022-10-25 12:57:52 -07:00
Harry
2da55a03b1
Fix outdated latestUnexpiredTimestamp when reading StoryContextAssociatedData from disk 2022-10-25 11:47:59 -07:00
Max Radermacher
1b5303c22c Remove unused BulkUUIDLookup 2022-10-25 00:41:24 -07:00
Max Radermacher
72c4dcff51 Simplify methods to populate missing UUIDs
We no longer need `isBlocking`, and we can always consider errors.
2022-10-25 00:41:24 -07:00
Max Radermacher
3aa95a999a
Update SignalCoreKit 2022-10-24 23:28:33 -07:00
Max Radermacher
4402f33e80 Use ProfileFetcherJob directly when in Swift 2022-10-24 23:26:49 -07:00
Max Radermacher
6971129f1d Remove redundant profile fetches in RequestMaker
We use RequestMaker in three places: fetching pre keys, sending
messages, and fetching profiles. In the former two cases, we want to
kick off profile fetches when certain errors occur.

However, in the latter case, we’re already doing a profile fetch, so we
don’t need to kick off another.

- If the UD request fails for a profile fetch, the next thing we try
  will be a non-UD profile fetch. In the prior version of the code, we’d
  also kick off a fresh profile fetch; since we just marked UD as
  disabled, this would initiate a redundant non-UD profile fetch.
  Instead, we can just rely on the non-UD request that’s underway.

- When a UD request succeeds & we didn’t know the UD access mode, we
  update the access mode to the one we used. In the prior version of the
  code, we’d also kick off a profile fetch with this access mode.
  However, if this is part of a profile fetch, we’ve *just* gotten the
  latest profile with the access mode we just saved, so there isn’t a
  reason to immediately initiate another fetch.
2022-10-24 23:26:49 -07:00
Max Radermacher
d68e854fa5 Remove Objective-C support from RequestMaker
It’s unused. Also, convert the result type to a struct.
2022-10-24 23:26:49 -07:00
Max Radermacher
9f30866fec Reformat RequestMaker initializers 2022-10-24 23:26:49 -07:00
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