Commit Graph

8012 Commits

Author SHA1 Message Date
Max Radermacher
27c985dcfd Don’t try to fetch profiles for e164s 2022-11-03 13:06:00 -07:00
Max Radermacher
ba238915a3
Clean up avatar download during profile fetches 2022-11-03 13:03:18 -07:00
Sasha Weiss
9d3e4043d1
Conditional for internal remote megaphone test 2022-11-03 12:26:31 -07:00
Max Radermacher
84a670bc2e Remove ReadyFlag.queueMode.
It’s unused and doesn’t appear to have ever been used.
2022-11-03 11:58:44 -07:00
Evan Hahn
aef20e182b Remove unused groupBy function
`git grep -w groupBy` returns no results after this change.
2022-11-03 11:42:19 -07:00
Sasha Weiss
c7dd7f4c84
Actions for donation megaphone 2022-11-03 11:39:37 -07:00
Igor Solomennikov
2df35033f2
Change TSAttachmentPointerState to a closed enum.
Fix a compiler warning about not handling unknown values.
2022-11-02 15:49:15 -07:00
Sasha Weiss
1cf1872771
Add LocalUserLeaveGroupJobQueue to SSKEnvironment 2022-11-02 10:53:21 -07:00
Sasha Weiss
39f927683f
Be more conservative about when we re-upload the local profile for commitments 2022-11-02 08:54:51 -07:00
Sasha Weiss
a2e138abfb
Ensure logging during NSE initialization is recorded 2022-11-01 20:32:54 -07:00
Evan Hahn
a941c82c14
Prefer isEmpty with strings
This change may improve performance slightly but should have no other
user impact.

`myString.isEmpty` is faster than `myString.count == 0` or equivalent,
because computing `count` may require iterating over the string.

I tried to fix all occurrences of this.

Tested this by sending a message in a group and doing a full
re-registration, just in case I broke something there.
2022-11-01 17:53:46 -05:00
Harry
3bf5b8ed10
Add stories kill switch 2022-10-31 12:30:56 -07:00
Max Radermacher
92ae34ee9c Enable Stories for everyone 2022-10-31 11:33:02 -07:00
Evan Hahn
85a0bb8566 Remove unused blurhash utility
This removes `isDarkBlurHash`. Its last usage was in
875491a7cd.
2022-10-31 09:35:20 -05:00
Ehren Kret
38af2a8a65 fix missed CGFloat for thumbnail 2022-10-28 15:46:32 -05:00
Ehren Kret
ab61bbc3a6
cleanup more xcode warnings 2022-10-28 13:54:31 -05:00
Ehren Kret
8e44265440 cleanup more unsigned v signed warnings 2022-10-28 13:53:08 -05:00
Ehren Kret
9a1e269e91 remove several signed conversion warnings 2022-10-28 11:56:12 -05:00
Sasha Weiss
6526a8a164
Remove all references to local 'subscriptionMegaphone' 2022-10-28 09:47:58 -07:00
Max Radermacher
f2afe8d45b Skip already-cached values in BulkProfileFetch
If we queue N UUIDs [1, 2, ..., N], we’ll send a request to fetch all of
them. If we queue those same N UUIDs again, we’ll stop processing after
the first one, without sending any fetch request.

We’ll start processing again the next time `process()` is called. This
could happen in response to network availability changing, or it could
happen in response to scheduling the N+1’th UUID. (Though, we won’t
necessarily fetch the N+1’th UUID in this case -- we’ll fetch the 2nd.)

These cached results also expire after a few minutes or a few hours,
depending on the most recent result. Therefore, this fetcher may behave
somewhat erratically, where it fetches profiles, stops for a few
minutes, then starts fetching profiles again.
2022-10-27 19:55:44 -07:00
Max Radermacher
39d85c255a
Persist updates as part of fetch profile promise
As far back as 823927685d, the profile
updates were asynchronous. At that point it time, it didn’t matter
because there wasn’t a completion block; callers couldn’t know when the
updates *should* be complete, so it didn’t matter when they finished.

However, in 856fef7664 a Promise result
was added, presumably to allow callers to know when it was safe to check
GV2 capabilities. Now, a cursory reading of the API would suggest that
all changes were persisted once the Promise was resolved.

This can result in bugs, such as [this example][0], where we fetch the
profile and then check a capability in the database. Even though it’ll
*probably* be the case, there’s no guarantee that the updated profile
will be persisted when we try to fetch the latest capability.

[0]: 465d00664b/Signal/src/ViewControllers/AppSettings/Donations/BadgeGiftingConfirmationViewController.swift (L69-L88)
2022-10-27 19:54:24 -07:00
Jordan Rose
e02855349c Don't trap in debug builds on oversized downloads 2022-10-26 17:23:44 -07:00
Sasha Weiss
44a7b9a3c3
Parse and check country-code CSV from remote megaphones 2022-10-26 16:03:52 -07:00
Evan Hahn
4675434c6c Add FiatMoney type
This change should have no user impact.

We commonly pair a currency, like USD, and an amount, like 1.23. This
adds the `FiatMoney` struct. It's a simple struct with two fields.

After adding it, I tried to use it everywhere. (It's possible I missed a
spot.)

I think this is a useful change on its own, but it'll be nice for an
upcoming change, too.

See also: [Android's equivalent class][0].

[0]: cb65347bb3/core-util/src/main/java/org/signal/core/util/money/FiatMoney.java (L1)
2022-10-26 17:04:51 -05:00
Sasha Weiss
1cb90e245f
Fetch and persist remote megaphones 2022-10-26 15:03:08 -07:00
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