Commit Graph

311 Commits

Author SHA1 Message Date
Max Radermacher
f848a6373f
Swiftify the rest of MessageSender 2023-11-27 11:29:23 -06:00
Max Radermacher
9692c83005
Clean up image quality getters
Co-authored-by: Harry <109690906+harry-signal@users.noreply.github.com>
2023-11-15 18:56:16 -06:00
Pete Walters
4c9210e60a
Disable JPEG attachment passthrough due to crash 2023-10-18 14:54:46 -05:00
Pete Walters
94df0160ae
Clean up warnings around designated/unavailable initializers 2023-09-06 22:01:10 -05:00
Harry
10985644b3
Add text formatting send support. 2023-06-23 10:26:46 -07:00
Igor Solomennikov
7790837eb5
Remove unnecessary "@objc" in SignalMessaging. 2023-05-16 16:41:49 -07: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
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
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
Harry
ae4837e600
Segment story videos longer than 30s
* initial approach commit, needs cleanup

* Keep >30s videos for non-story recipients, but split for stories

* Some cleanup

* fix too many chats toast offset

* show tooltip in the send flow

* pr feedback
2022-09-16 15:29:44 -07:00
Evan Hahn
4445f0cedf
Improvements to PNG transcoding 2022-09-13 23:22:50 +00:00
Sasha Weiss (Signal)
5695809776
Prevent non-temporary-file attachments from being deleted when shared 2022-06-22 13:15:04 -07:00
Nora Trapp
c174899720 Propagate blurhashes during attachment multisend 2022-06-17 15:38:30 -04: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
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Martin Böttcher
8f9be31ba3 replaced NSLocalizedStringFromAppBundle with OWSLocalizedString 2022-03-08 10:17:25 +01:00
Martin Böttcher
c0adfbfb32 NSLocalizedString is replaced by NSLocalizedStringFromAppBundle (reading strings from the bundle of the main app) for all source files called by an app extension and the localizable files are removed for the app extension targets. 2022-03-07 13:29:06 +01:00
Matthew Chen
25f015d8bc Add SignalUI framework target. 2021-10-19 09:39:53 -03:00
Matthew Chen
c416609108 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00
Matthew Chen
b9b66646ff Add SignalUI framework target. 2021-10-19 09:39:52 -03:00
Matthew Chen
71ca6d7b2e Fix edge cases around short video. 2021-10-05 10:06:01 -03:00
Nora Trapp
2814ab7629 Convert to new Promise library 2021-09-03 11:41:34 -07:00
Matthew Chen
617a8b3acd Fix message forwarding issues. 2021-08-25 11:04:13 -03:00
Matthew Chen
ae0b4d59a2 Modify forward flow multi-forward. 2021-08-19 16:57:01 -03:00
Nora Trapp
00d395f7b3 Allow images to maintain original quality if below a certain size 2021-08-18 15:16:00 -07:00
Matthew Chen
4b77df38fa Refine names. 2021-08-18 15:01:04 -03:00
Matthew Chen
d51213a8f5 Refine error localizedDescription. 2021-08-18 15:01:04 -03:00
Matthew Chen
fcdca12cf5 Deprecate REST, Part 1
* Port socket manager to Swift.
* Clean up HTTP request success/failure state & errors.
* Rework network manager.
* Rework HTTP errors.
* Rework errors "properties": isRetryable, etc.
* Fix test breakage.
2021-08-18 14:25:36 -03:00
Matthew Chen
757ee0c910 Merge branch 'release/5.18.2' 2021-08-17 10:17:54 -03:00
Michelle Linington
ab31056108 Fix issue where gifs are sent as a compressed jpeg
Our new compression path is compressing *all* images. We should only be
compressing non-animated images. Compressing a gif to a jpeg will mean
we lose animation data.

This wasn't caught in beta since the beta population is migrated into
sending mp4 gifs. The new compression path doesn't touch mp4s.
2021-08-16 15:09:23 -07:00
Nora Trapp
65ff51acb4 Send all messages via MessageSenderJobQueue 2021-08-16 13:27:43 -07:00
Nora Trapp
7a8fbcc9f4 Don't allow sending high quality outside of the main app 2021-07-23 21:20:08 -07:00
Nora Trapp
d15d0bf221 Preserve image orientation when downsampling is not required 2021-07-23 21:20:08 -07:00
Nora Trapp
fdccbd71a6 Allow image quality selection 2021-07-22 13:57:25 -07:00
Nora Trapp
3a431c25f4 Disable unnecessary job queues from running in extensions 2021-06-24 12:20:46 -07:00
Matthew Chen
22871308ef Port CVC to Swift. 2021-06-18 09:37:44 -03:00
Matthew Chen
786e7cef3d Fix build warnings. 2021-06-07 11:11:28 -04:00
Nora Trapp
6783db210e Add default disappearing message timer 2021-04-29 15:46:43 -07:00
Michelle Linington
054c7a0b0c MP4 looping media support
- Fetch mp4s from Giphy for showing previews
- Fetch mp4s from Giphy for sending (behind featuree flag)
- A new flag on attachments to tag a video as "looping media"
- Videos tagged with this flag will be shown on repeat
2021-04-22 14:53:47 -07:00
Matthew Chen
4959f555f4 Handle video export errors. 2021-04-14 17:34:38 -03:00
Nora Trapp
4dae0ce79a Convert all non-sticker images to jpg 2021-03-27 12:12:46 -07:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00
Nora Trapp
303b3220d9 Actually thumbnail attachments on the attachment preview view 2021-03-17 13:15:51 -07:00
Nora Trapp
ab85b22856 Use CGImageSource for downsampling attachments 2021-03-15 15:05:36 -07:00
Nora Trapp
0785e301cf Clear SignalAttachment caches when we get a memory warning 2021-03-09 12:37:36 -08:00
Jordan Rose
14c93cbd20 Preserve orientation when stripping image metadata 2021-02-11 10:10:16 -08:00
Nora Trapp
dac30cf4db Don't store group threads in memory when sharing 2021-02-05 11:22:15 -08:00
Matthew Chen
645bd76bd5 Rework app readiness. 2021-02-04 09:55:39 -03:00
Matthew Chen
23dc0f021c Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00
Matthew Chen
0931081de1 Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00