Commit Graph

153 Commits

Author SHA1 Message Date
Ehren Kret
de32c7799d remove NSObject and Dependencies extension computed vars for SignalServiceKit 2024-10-11 23:12:59 -05:00
Ehren Kret
5ea36cd91b enable internal imports by default 2024-09-29 20:03:17 -05:00
Ehren Kret
cb27389cef enable swiftlint mark rule 2024-08-30 22:05:59 -05:00
Ehren Kret
0ab16e43a4
remove the last chunk of objc in the main app target 2024-05-13 12:35:01 -05:00
Jordan Rose
b0de59f2e2 Remove required from every init that is not dynamically dispatched
This included:
- Removing unavailable inits wholesale if no longer `required`
- Marking a few classes `final` so they could continue using
  `Self(...)` rather than `OWSWhatever(...)`
2024-04-01 15:27:20 -07:00
Elaine
f7f9d1ef82
Update existing bar button items using the new convenience methods 2024-03-25 12:20:19 -06:00
Max Radermacher
42c704a4e3
Remove some debug/verbose lines 2024-03-19 19:24:54 -05:00
Max Radermacher
0a24b7b357
Clean up recipient searches 2024-03-07 11:57:45 -06:00
Max Radermacher
b6fec5c1db
Remove a bunch of debug Bench events 2023-11-21 11:12:18 -06:00
Igor Solomennikov
52f0015dfe
New set of icons. 2023-06-22 17:38:01 -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
Harry
f728457039
Update build target to iOS 13.0 2023-06-08 16:21:20 -07:00
Igor Solomennikov
20c55e7dec
Add necessary imports to Swift files.
Necessary for converting ChatListVC to Swift.
2023-06-05 16:04:48 -07:00
Igor Solomennikov
2f71d6a2c6
Convert OWSWindowManager to Swift as WindowManager. 2023-06-01 10:55:21 -07:00
Igor Solomennikov
f8a79687a7
Remove unnecessary @objc from the main app target. 2023-05-16 16:33:45 -07:00
Evan Hahn
14237a873f
NSLocalizedString -> OWSLocalizedString 2023-04-25 13:28:46 -05:00
Igor Solomennikov
6dd3d9a6f2
Convert all convenience methods in UIFont+OWS to Swift. 2023-04-18 17:14:51 -07:00
Jordan Rose
f5e206da23 Revert "Use supportedInterfaceOrientations to force calls to portrait"
This reverts commits 41b381b1b1 and
856ced4062.
'supportedInterfaceOrientations' doesn't behave correctly in certain
scenarios, including when the app is *launched* in landscape.
2022-10-19 10:37:51 -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
Evan Hahn
4d55d95869 Autofix SwiftLint whitespace issues
I recommend reviewing this with whitespace changes disabled.
2022-09-15 16:37:44 +00:00
Jordan Rose
41b381b1b1 When starting a call, attemptRotationToDeviceOrientation()
Speculative fix for a hard-to-reproduce issue where the call view ends
up laid out in landscape and then clipped to portrait, rather than
being forced to portrait in the first place.

Possibly fallout from 856ced4062, which replaced an explicit call to
our UIDevice.ows_setOrientation(). We don't want to revert to that
because it messes up legitimate orientation detection.
2022-08-23 10:45:27 -07:00
george-signal
54fbe0b948
Don't show call window for already-terminated calls. 2022-08-12 13:04:38 -07:00
Jordan Rose
856ced4062 Use supportedInterfaceOrientations to force calls to portrait
Previously this used UIDevice.ows_setOrientation, an undocumented hack
to basically lie to the device about which way is up. This sounds
sketchy, but it's the result of a lot of testing various solutions for
something that could reliably force the app into portrait orientation.

However, every UIWindow has its own "supported orientations", provided
by the root view controller. And calls are implemented in their own
UIWindow (so that they don't disrupt whatever you were doing). So for
*calls specifically*, we can use supportedInterfaceOrientations to
force the app into portrait mode.

All other callers of UIDevice.ows_setOrientation work in the shared
main window, so they'll be left alone. This only changes things for
the call window.
2022-08-10 10:28:19 -07:00
Martin Böttcher
db44bb5017
Fix wrong localization key
Co-authored-by: Martin Böttcher <martin.boettcher@greenbytes.de>
2022-05-04 09:54:09 -05:00
Martin Böttcher
54b743de2d
moved older stringsdict changes into new branch; minor changes (#4205)
moved older stringsdict changes into new branch
2022-04-28 17:41:43 +02:00
Michelle Linington
d54d654cfc PR Feedback: Remove notImplemented altogether 2022-04-13 20:21:47 -07:00
Igor Solomennikov
4013006802 Use obscuresBackgroundDuringPresentation instead of dimsBackgroundDuringPresentation.
`UISearchController.dimsBackgroundDuringPresentation` is deprecated in iOS 12.
2022-04-12 13:24:57 -07:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Michelle Linington
7567dc146f Lint 2022-01-12 23:19:36 -08:00
Michelle Linington
76f13a4373 Fixes a bunch of unresolved symbol errors
Things succeed when building, but before and after Xcode is littered
with errors.
2022-01-12 23:19:36 -08:00
Matthew Chen
fc749b4d72 Change phone number. 2021-11-19 14:28:18 -03:00
Matthew Chen
3d7e8a0ba4 Add script to normalize includes and imports. 2021-10-21 09:21:12 -03:00
Matthew Chen
5d780d1589 Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
Matthew Chen
7d0485661d Move window manager to Signal target. 2021-10-19 17:59:13 -03:00
Nora Trapp
7ffcb089e4 Add haptic feedback to mention picker 2020-08-13 10:58:28 -03:00
Matthew Chen
a80eaf4ff2 Respond to CR. 2020-07-10 11:49:47 -03:00
Matthew Chen
1d2a1a2a26 Generate haptic feedback on main thread. 2020-07-10 11:29:16 -03:00
Nora Trapp
8a10d631f9 Add haptic feedback 2020-06-01 12:52:59 -07:00
Nora Trapp
88ac10de05 Notification Service Extension
The NSE should only run on iOS 13.3 or later where the "filtering" entitlement
is available since our notifications don't contain any content and will often
not trigger any user visible content. We control this by setting the deployment
target to iOS 13.3.

This does not handle calls as it's currently impossible to wake the main app or
launch CallKit from within the NSE. Should we reach a point where we need to use
this extension in production the service will need to be able to differentiate
between call and non-call messages and deliver them as VOIP or Vanilla pushes as
appropriate. Alternatively, Apple may introduce some way for us to signal the
main app that a call message has been received.

This does not currently address the potential for the NSE and the main app to be
running and trying to process messages at the same time. As long as the
websocket is connected and the main app is processing messages in a timely
fashion the NSE will never be called since the service will not send pushes for
these messages, but censorship circumvention users and users where the websocket
is disconnected for some reason will legitimately receive pushes and we will
want to process those messages. How we will handle these cases requires further
thought since just terminating the NSE when the app launches is not sufficient.
We could potentially do something like terminate the NSE everytime the main app
runs the message fetcher job which should only happen if either the user
pulls-to-refresh on the conversation list or the websocket is actively connected
and receiving messsages. I plan to address this in a follow-up pull request.

Currently this code will not ever be run since the service never sends vanilla
push notifications. Eventually we will need to add logic into the main app to:
a) detect we're on iOS 13.3 or later and b) update a flag on the service telling
it to stop using VOIP pushes for non-call messages. The API for requesting this
from the service does not yet exist.
2020-01-30 11:44:41 -08:00
Nora Trapp
31779b803e More specific reactions notifications 2020-01-27 11:59:30 -08:00
Matthew Chen
41f314ba1f Respond to CR. 2020-01-16 17:44:56 -03:00
Nora Trapp
61fe37de2b Hack around split view bug 2020-01-08 17:39:51 -08:00
Michael Kirk
f1dc3e564d expects to be called on main thread 2020-01-03 11:26:54 -07:00
Matthew Chen
ee819340c7 Always migrate to GRDB; show notification during background migrations. 2020-01-02 12:12:18 -08:00
Matthew Chen
c23ed76df0 Always migrate to GRDB; show notification during background migrations. 2020-01-02 12:12:18 -08:00
Michael Kirk
9d61e15685 Show info message context only when appropriate 2019-12-18 12:10:48 -08:00
Michael Kirk
997c93bc8e more logging around push registration failure checking 2019-12-13 07:55:33 -08:00
Nora Trapp
8d0a8ca3bd Notify for incoming reactions to your message 2019-12-03 15:26:01 -08:00
Nora Trapp
87ecf90bee Merge branch 'release/3.0.0' 2019-11-20 16:46:39 -08:00
Matthew Chen
35989761c2 Refine notifications.
Thanks to teor at The Tor Project.
2019-11-20 13:21:47 -03:00