Commit Graph

158 Commits

Author SHA1 Message Date
Sasha Weiss
5d7241d038
Add parsing support for the pni capability 2023-03-24 10:07:39 -07:00
Max Radermacher
135074b570 Verify IAS certificates using LibSignalClient 2023-02-10 10:23:50 -08:00
Sasha Weiss
e5f1af6c2e
Support lookup-by-username 2023-02-08 10:16:57 -08:00
george-signal
5fe81c0ad3
Show video duratioin in All Media. 2023-02-03 16:00:46 -08:00
Evan Hahn
8d707a9c74
Add spam reporting tokens 2023-01-25 14:14:57 -06:00
Max Radermacher
0dc492fec5
Use common logic when creating web sockets 2023-01-24 14:01:34 -08:00
Evan Hahn
6e97ff3c8f
Gifting: add PayPal support 2023-01-18 16:38:57 -06:00
Harry
b3136fb42c
Call Disposition
* Add CallEvent sync message proto

* Add CallRecord class and db table

* Renames and comments for clarity

* create and update CallRecord from local device call events

* Handle incoming call event sync messages

* Add outgoing call sync event piping

* Send call event sync messages

* Handle call record sync messages before the app is launched

* Mark TSCall interactions as read and update their status when getting call event sync messages

* Prevent CallKit race conditions by checking state before creating TSCall interactions

* Update chat call event text for unanswered and declined calls

* Remove incorrect debug assert which fires every time a call is missed in the background

* PR comments, mostly nits

* convert old debug assert into a log + task comment

* nit

* Update copy for in chat call logs

* Smaller PR comments

* Add foreign key to CallRecord's interactionUniqueId

* Update write transaction ordering comment

* run genstrings

* fix strings
2023-01-10 11:48:46 -08:00
Max Radermacher
921301cdb0
Add CDSv2 2022-12-14 16:30:35 -08:00
Sasha Weiss
ee4799b506 One-time donations via PayPal 2022-12-01 14:39:03 -08:00
Max Radermacher
0606340fc5
Remove old CA certificate 2022-11-30 14:31:25 -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
Sasha Weiss
c7dd7f4c84
Actions for donation megaphone 2022-11-03 11:39:37 -07:00
Max Radermacher
9db9d94085
Handle isComplete during incoming contact syncs 2022-10-19 09:29:52 -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
Sasha Weiss
151e8b8044
Migrate from ExperienceUpgradeId to ExperienceUpgradeManifest (#5163) 2022-10-17 09:55:12 -07:00
Harry
74228f424e
Add StoryContextAssociatedData to compute story tab badge count without hidden stories
* Add StoryContextAssociatedData and db migrations

* Remove hideStory from ThreadAssociatedData

* Remove lastViewedStoryTimestamp and lastReceivedStoryTimestamp from TSThread

* drop deprecated columns in db migration

* add indexes

* dump schema.sql

* Update unviewed stories SQL query

* fix thread fetching for incoming story messages

* reload story tab badge when StoryContextAssociatedData changes

* Add test for TSGroupModel backwards-compatible deserialization

* move db migration

* Only use StoryContextAssociatedData for story badge count

* update StoryContextAssociatedData lastReceivedTime when a story message is deleted

* catch group threads for outgoing story messages too

* clean up sql query

* Only update lastReceievedStoryTimestamp for remote deletions

* add latestUnexpiredTimestamp to StoryContextAssociatedData
2022-10-03 21:16:01 -07:00
Harry Sanabria
ad65ef501f Add lastReceivedStoryTimestamp to schema.sql 2022-09-22 17:05:06 -07:00
Nora Trapp
9776699137 Sync when contacts become unregistered 2022-09-15 14:09:03 -07:00
Harry
de198f118b
Add story hidden state to ThreadAssociatedData
* Add story hidden state to ThreadAssociatedData

* make hideStory column non-null
2022-09-02 12:03:50 -07:00
Sasha Weiss
569cdb2aad
Durable jobs for leaving groups 2022-08-26 13:13:23 -07:00
Nora Trapp
89076ed822 Fix stories tab badging 2022-08-20 15:01:03 -07:00
Nora Trapp
1d9a8a8995 Add lastViewedStoryTimestamp to TSThread 2022-08-15 14:15:11 -07:00
Nora Trapp
edc5c7beae Fix schema.sql for 2022-08-08 14:34:51 -07:00
harry-signal
741c3961bd
Add audioPlaybackRate thread-level metadata to ThreadAssociatedData table 2022-08-01 15:34:40 -07:00
Evan Hahn
64462ac1b0 Save a receipt when you send someone a badge
This commit:

1. Adds a new donation receipt type: gifts.
2. Saves receipts when sending someone a gift.

The first part was the main challenge. Previously, donation receipts had
logic like this (pseudocode):

     def getReceiptType(self):
       if self.subscriptionLevel:
         return "subscription"
       else:
         return "one-time"

Now, we explicitly encode the type and have logic to handle "legacy"
receipts that don't have a type encoded.
2022-07-08 13:17:30 -05:00
Evan Hahn
f5556d1857
Use durable job for sending badge gifts
Previously, sending a gift badge was not a durable operation, which
meant that crashes/failures could cause users to have their payment
methods charged without actually sending the badge.

Now, the flow is split up into two steps: non-durable parts before the
charge is attempted, and durable parts afterward.

The high-level flow is:

1. Prepare the payment, which involves a couple of repeatable network
   requests.
2. Enqueue a job with the prepared payment, that:
   1. Charges the payment method (idempotently)
   2. Requests a receipt credential (idempotently)
   3. Enqueues a gift message, and optionally a text message
3. When the job completes, open the conversation in the UI.
2022-07-01 17:10:31 -05: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
8009206c18 Respect recipient capabilities when sending gift badges
This respects the `giftBadges` capability when trying to send gift
badges. In other words, it prevents you from sending gift badges to
someone who lacks the capability.

The bulk of this change involves fetching and saving of this new
capability. The rest of the code involves showing it on the "choose
recipient" screen (and some debug screens).
2022-06-10 22:37:22 +00:00
Max Radermacher
724ea55aa7 Add giftBadge property to messages
Also run `Scripts/sds_codegen/sds_codegen.sh`
2022-05-27 12:31:24 -07:00
Max Radermacher
da08463ade Add duration column to model_ProfileBadgeTable 2022-05-26 16:14:40 -07:00
Michelle Linington
98846da1f1 Adjust disappearing message index
The existing index was not useful for the query we needed. Running this
query would open a write transaction for several seconds on every
launch. This new index should be much faster.
2022-04-27 12:25:10 -07:00
Evan Hahn
8b072620a6 Add "Donation Receipts" view 2022-04-11 16:21:12 -05:00
Nora Trapp
702e38e7ff Break up index migrations over multiple releases 2022-04-01 16:21:21 -07:00
Nora Trapp
409e89e721 Add index for story reply counts 2022-03-31 01:52:54 -07:00
Nora Trapp
e662b099dd Check if a user is stories capable when sending group replies 2022-03-31 00:37:56 -07:00
Nora Trapp
4c6aa8de2d Add storyReactionEmoji column to TSMessage 2022-03-31 00:34:33 -07:00
Nora Trapp
e95e392494 Add story context to TSInteraction 2022-03-31 00:34:32 -07:00
Nora Trapp
d7f12d3f39 Convert StoryMessageRecord to use new SDSCodableModel 2022-03-16 17:54:38 -07:00
Nora Trapp
a656c91fcf Store the timestamp when a story was viewed 2022-03-16 17:53:28 -07:00
Nora Trapp
5673b73c3a Add HomeTabBarController 2022-03-16 17:52:41 -07:00
Nora Trapp
376471587f Backend support for stories receipt 2022-03-16 17:51:48 -07:00
Ehren Kret
41a289946b Add support for new certificate authority
TextSecure CA expires in ~1 year; time for new one.
2022-01-26 12:59:45 -06:00
Nora Trapp
edc89c3db1 Store badge receipt credential presentation on the durable job 2021-11-17 15:14:03 -08:00
Eugene Bistolas
78cb9352c3 [Badging] Durable receiptCredential fetch and redemption 2021-11-15 12:47:35 -10:00
Michelle Linington
ebadb12dad Minor comment tweaks, schema adjustments 2021-11-09 14:25:42 -08:00
Michelle Linington
d1f53b7151 Fix nullability of new OWSUserProfile property 2021-11-09 14:25:42 -08:00
Michelle Linington
fa0d10f047 Firm up database schema 2021-11-09 14:25:42 -08:00
Matthew Chen
997f354f74 Only warn in logs when duplicate decryptions occur. 2021-09-28 17:22:17 -03:00
Matthew Chen
73b019f8da Refine decrypt deduplication. 2021-09-23 23:22:26 -03:00