Commit Graph

80 Commits

Author SHA1 Message Date
Harry
00a73e072d
Use transactions in TSMessage attachment id(s) getters/setters 2024-02-06 08:50:44 -08:00
Harry
eb98b0bbf6
GRDBReadTransaction->SDSAnyReadTransaction on TSMessage attachment getters 2024-02-02 15:32:22 -08:00
Harry
75cf24131c
Allow story message attachments to reference a foreign table 2024-02-02 15:29:58 -08:00
Harry
2a95e36240
Push TSAttachment's TSAttachmentType getter methods up one level, requiring the containing message 2024-02-02 13:53:47 -08:00
Max Radermacher
0b2652c7ad
Add PhoneNumberStatus for vCard logic 2024-02-01 14:10:05 -06:00
Harry
ed048b0eb5
Backup/Restore pinned thread ordering 2024-01-04 05:58:35 -08:00
Harry
ab59918336
Make timestamp on quoted messages optional 2023-12-21 08:36:04 -08:00
Harry
a62c393d8e
Split second and third person for STORY_REACTION_QUOTE_FORMAT and STORY_REPLY_REACTION 2023-12-12 14:13:11 -08:00
Max Radermacher
ba4034f5a7
Remove SSKJobQueues 2023-12-11 14:22:22 -06:00
Max Radermacher
137b889e1a
Clean up some prod benchmarks 2023-11-27 16:03:41 -06:00
Max Radermacher
b045436091
Remove some verbose benchmarks 2023-11-21 11:13:09 -06:00
Igor Solomennikov
be1d8220d3
Convert OWSContact to Swift. 2023-11-07 16:21:00 -08:00
Harry
aa0e250cb7
[Death to TSAccountManager, long live TSAccountManager][9] Migrate usages of old TSAccountManager to new 2023-10-05 08:56:08 -07:00
Harry
2ac759408a
[MOB] Payment messages in chat 2023-08-24 13:55:39 -07:00
Sasha Weiss
84957f66eb
Clean up InteractionFinder 2023-08-21 18:08:10 -07:00
Sasha Weiss
06e1a416cc
Remove the "Any...Finder" pattern from a bunch of types 2023-08-21 10:27:07 -07:00
Max Radermacher
3f522fa57a
[ServiceId] Update StoryMessage 2023-08-15 12:45:20 -05:00
Harry
c9bd43c0ab
Spoiler animations part 6: story captions and text stories 2023-07-17 08:33:29 -07:00
Pete Walters
020d099607
Add Edit Send Plumbing 2023-06-30 09:47:55 -05:00
Igor Solomennikov
0e9d511d1d
SignalUI cleanup.
• convert ObjC code from UIView+SignalUI to Swift.
• separate code from UIView+SignalUI to smaller files by functionality.
2023-06-23 14:36:21 -07:00
Igor Solomennikov
0686b39547 Add necessary imports to Swift files.
Those would be required for future PRs.
2023-06-13 14:46:12 -07:00
Igor Solomennikov
c84033a308
Convert OWSQuotedReplyModel to Swift as QuotedReplyModel. 2023-06-06 14:55:35 -07:00
Max Radermacher
ca3b018734
Add & use DisappearingMessagesConfigurationStore 2023-06-05 11:00:38 -05:00
Igor Solomennikov
92ca9ed82c
Convert CVItemViewModel protocol to Swift. 2023-06-02 20:26:58 -07:00
Igor Solomennikov
ef5dc5c4fc
Convert ThreadUtil to Swift. 2023-05-30 09:45:08 -07:00
Max Radermacher
0681121776
Introduce ConversationViewModel 2023-05-24 09:46:11 -07:00
Igor Solomennikov
c054f3de91
Remove unnecessary "@objc" in SignalUI. 2023-05-16 16:39:19 -07:00
Harry
1fe5612cff
Support text formatting in text stories 2023-05-11 10:42:37 -07:00
Harry
c8da382654
Handle text formatting styles in conversation list snippets 2023-05-03 22:04:05 -07:00
Harry
b3700d07ce
Refactor mention/style/search result attribute application 2023-05-01 13:57:07 -07:00
Max Radermacher
a0a552682d
Improve search perf with lots of group members 2023-04-10 19:31:46 -07:00
Harry
224e5a7c6b
Parse text formatting styles in MessageBody
* add deserialization test for MessageBodyRanges

* Add style ranges to MessageBodyText

* add deserialization tests and fix small other test

* add basic mention hydration tests

* Add RTL support for @mention hydration

* Add a test with accents for unicode shenanigans

* unique-ify TODOs

* Add emoji test and fix implementation to account for multi-point unicode that is captured in NSString.length but not String.count

* Add more TODOs for text formatting

* Collapse style ranges on init

* Handle mention overlaps on MessageBodyRanges init

* add tests, update existing tests, fix bugs

* Update v2 deserialization test; the meaning of Style raw values has changed

* comment nit
2023-04-04 12:46:09 -07:00
Max Radermacher
93d97da82b
Split “in progress” & “saved” voice message drafts 2023-03-08 15:31:56 -08:00
Evan Hahn
578241cfdf Lower bitrate for audio and switch to mono 2023-01-31 10:29:04 -08:00
Evan Hahn
f2c218edca
Use new copy for in-chat gift messages
This required plumbing the other person's "short name", which is the
most significant code change.
2023-01-11 14:18:48 -06:00
Igor Solomennikov
41b1469f7a
Convert OWSAudioPlayer to swift and lose 'OWS' prefix.
Also rename OWSAudioSession to AudioSession for consistency with everything else.
2022-12-06 16:00:58 -08:00
Sasha Weiss
242dfd2bce
Add all JobQueues to environment, via a wrapper
Currently, only some `JobQueue` types are initialized during startup
(as part of `Environment`, or `SSKEnvironment`). Initialization is
required, however, for a `JobQueue` type to restart any latent jobs.
That means that, for example, a durable `SendGiftBadge` job that failed,
and should be reattempted at a later date, will not in fact be restarted
since no `SendGiftBadgeJobQueue` will be initialized at launch.

This change adds `SSKJobQueues` and `SignalMessagingJobQueues` types,
which are intended to be singletons that hold within them a singleton
job queue for each of our `JobQueue` types. These wrappers are added to
`SSKEnvironment` and `Environment` (from SignalMessaging) respectively,
ensuring that all the `JobQueue`s they contain are initialized as part
of environment setup. The wrappers also avoid the need to add a new
property to the (already large) environment types for each new future
`JobQueue`.

This change also updates all existing call sites that accessed a
`JobQueue` from an environment object, to direct that access now through
the wrapper type.
2022-11-09 14:08:44 -06: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
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
Nora Trapp
565ffe4f5a Don't show story ring on note-to-self 2022-09-12 11:23:23 -07:00
Nora Trapp
73316f2420 Notify for replies to group stories 2022-09-08 17:12:24 -07:00
Evan Hahn
6737d09e22
ThreadViewModel no longer needs Objective-C interoperability
The last Objective-C reference to `ThreadViewModel` was removed in
793101f0e4, so we can remove a bunch of
`@objc` annotations.
2022-08-31 15:51:25 -07:00
Evan Hahn
48c3c08c10 Fix vertical_parameter_alignment SwiftLint violations
This fixes violations of [SwiftLint's `vertical_parameter_alignment`
rule][0]. This should have no user impact.

[0]: https://realm.github.io/SwiftLint/vertical_parameter_alignment.html
2022-08-18 10:37:09 -05:00
Nora Trapp
7a84d7605b Allow viewing your own sent stories 2022-08-01 12:44:31 -07:00
Max Radermacher
369118b045 Add support for replying to gift messages 2022-07-07 10:49:20 -07:00
Evan Hahn
5696c50d7d Make some outgoing message params optional
We frequently send outgoing messages with some parameters, like "link
preview" or "quoted reply", empty.

This change lets those parameters be omitted (instead of explicitly
empty) for brevity.

This is a stylistic change and should have no user impact.

Tested this by sending a regular message, a message with a link preview,
and two messages with photos.
2022-06-23 12:53:05 +00:00
Evan Hahn
b5b560a0fe Shorten message send expiry timer lookup
Similar to e79f37cc01.
2022-06-22 14:35:48 -07:00
Evan Hahn
7e0fa84c6d Only add necessary completion callbacks to message send transaction
You can add callbacks to be executed when a transaction completes. We
usually do this when sending messages, but not always.

Previously, the logic was "add a callback that runs the completion
function, if it exists." Now, the logic is "if the completion function
exists, add a callback that runs it."

I think this slightly better reflects our intent, and helps reduce
memory usage (and potential capturing?) slightly.
2022-06-21 16:46:59 +00: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
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