Commit Graph

39 Commits

Author SHA1 Message Date
Igor Solomennikov
37e1a99209
Big update of link preview views.
LinkPreviewView was previously used to show link previews in chat and in Share Extension when text being shared contained an url. This commit renames LinkPreviewView to CVLinkPreviewView and simplifies the component to only handle sent links - support for showing intermediate "loading" state as well as having a cancel button to remove link preview - has been removed from this class.

OutgoingLinkPreviewView is used to show "link preview draft" in the chat input toolbar. This commit renames the class to LinkPreviewView and adopts this component to be used in Share Extension in place of the component mentioned above.

All those changes result in update link preview UI in Share Extension - visible when sharing a website from Safari or other mobile browser.
2026-02-26 21:12:36 -08:00
Sasha Weiss
d267ec8305
Run swiftformat . 2025-12-30 11:34:05 -08:00
Max Radermacher
f686c56883
Remove SignalAttachment.isConvertible… properties 2025-11-24 13:52:39 -06:00
Max Radermacher
3cd06fcfeb
Use ACIs for mention candidates 2025-10-30 12:36:34 -05:00
Igor Solomennikov
af48dd5186
Workaround for dysfunctional UIKeyboardLayoutGuide on iOS 15.
• bring back keyboard frame tracking to OWSViewController if running on iOS 15.
• add our own layout guide to OWSViewController that is updated based on keyboard frame notifications on iOS 15; on newer iOS versions it's a proxy to view.keyboardLayoutGuide.
• use OWSViewController.keyboardLayoutGuide where needed.
• in media composer screen (not OWSVIewController subclass) we already track keyboard frame - use that to position bottom toolbar on iOS 15.

I have also discovered that profile avatar editing screen was somewhat broken on older (15, 16) iOS versions. Fixed that here.
2025-10-02 10:12:45 -07:00
Igor Solomennikov
b0366644ab
Stop using InputAccessoryViewPlaceholder in text sharing screen.
The view is presented when sharing text from other apps.

The change is to use root view's keyboardLayoutGuide for constraints.
2025-09-23 12:01:30 -07:00
Harry
428b27fea3
Pipe up memoji from NSAttributedString attributes 2025-01-31 16:01:06 -08:00
Marissa Le Coz
0621ab8691
Randomize call link icon colors 2024-10-15 13:12:24 -04:00
Marissa Le Coz
9b7902a829
Add preview support for call links in drafted messages 2024-10-01 15:19:49 -04:00
Ehren Kret
5ea36cd91b enable internal imports by default 2024-09-29 20:03:17 -05:00
Max Radermacher
b9f49023ad
Send call link link previews 2024-07-26 22:00:54 -05:00
Max Radermacher
f2eb7f5a22
Extract LinkPreviewFetcher into its own type 2024-07-26 21:45:22 -05:00
Max Radermacher
82a87d6c9f
Asyncify LinkPreviewManager 2024-07-25 02:33:13 -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
Harry
a55476d667
Modernize LinkPreviewManager 2024-03-19 13:46:09 -07:00
Harry
c5b42c9b66
Don't generate link previews for links in spoilers 2023-09-25 10:55:02 -07:00
Harry
8b58124ded
Fix miscolored placeholder text in media send flow and group story reply input. 2023-07-13 14:18:26 -07:00
Harry
ef1dfc1316
Add messageBody as a type of DisplayableText 2023-07-07 13:41:24 -07:00
Harry
10985644b3
Add text formatting send support. 2023-06-23 10:26:46 -07:00
Harry
9aecfe3af5
[TextFormatting Send] UIMenu for formatting selected text 2023-06-15 15:45:36 -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
Harry
b3700d07ce
Refactor mention/style/search result attribute application 2023-05-01 13:57:07 -07:00
Igor Solomennikov
6dd3d9a6f2
Convert all convenience methods in UIFont+OWS to Swift. 2023-04-18 17:14:51 -07:00
Max Radermacher
7ac03076e6
Consolidate link preview fetching code 2023-02-21 12:49:25 -08:00
Harry
003cc19e62
Update SignalCoreKit. Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params
* Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params

* Update SignalCoreKit
2023-02-07 16:14:39 -08:00
Max Radermacher
6763747349
Attach link previews present in the message text 2022-12-07 16:13:49 -08:00
Igor Solomennikov
dbb0824303
Improve animations in conversation input bar
* Make text input field's background translucent.

* Add animations to link preview panel in conversation input toolbar.

* Remove unused LinkPreviewViewDraftDelegate method.

* Add comment explaining layout logic.

* Improvements to "suggested stickers" panel in conversation input bar.

• ensure the panel doesn't show behind the text input area when sliding down.
• create panel lazily when it's needed for the first time.

* Do not disable user interaction on animated views in conversation input bar.

This change fixes an issue where Send button wasn't responsive for a few hundreds
of milliseconds after becoming visible.
2022-11-21 11:37:21 -08:00
Igor Solomennikov
6a7d6c0fae
Switify some code related to ConversationInputToolbar.
* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
2022-11-07 16:32:59 -08: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
Igor Solomennikov
094fa0f30d
Allow attaching links to text stories with "Generate Link Previews" setting being OFF. 2022-09-21 14:55:49 -07:00
Sasha Weiss (Signal)
2f4ded9d03
Fix reentrant DB read on mentions processing 2022-06-20 13:21:22 -07:00
Max Radermacher
66a2638edd Don’t attach canceled link previews 2022-06-09 15:10:50 -07: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
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
c416609108 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00