Skip to content

Commit 26500c8

Browse files
committed
Feat: add warning to connection requests
1 parent 28246f7 commit 26500c8

9 files changed

Lines changed: 33 additions & 26 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ To rebuild a dependency and use it in the umbrella project, run:
6363
carthage bootstrap --platform ios --use-xcframeworks
6464
```
6565

66+
To run tests, make sure to use a simulated iPhone 17 with iOS 26.1, as reference screenshot tests rely on that layout.
67+
6668
### Known Limitations
6769

6870
Notifications sent through the Apple Push Notification service can only be received by the App Store Wire client, which is code-signed with Wire's own certificate. This is a security feature enforced by Apple, as documented in Apple's [Local and Remote Notification Programming Guide](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/). Any client built from source will not be able to receive notifications.
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

wire-ios/Wire-iOS/Generated/Strings+Generated.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5011,13 +5011,15 @@ internal enum L10n {
50115011
/// Guest
50125012
internal static let guest = L10n.tr("Localizable", "profile.details.guest", fallback: "Guest")
50135013
/// Get certainty about %@’s identity before connecting.
5014+
/// Wire’s Support team will never reach out to you in the app.
50145015
internal static func identityWarning(_ p1: Any) -> String {
5015-
return L10n.tr("Localizable", "profile.details.identity_warning", String(describing: p1), fallback: "Get certainty about %@’s identity before connecting.")
5016+
return L10n.tr("Localizable", "profile.details.identity_warning", String(describing: p1), fallback: "Get certainty about %@’s identity before connecting.\nWire’s Support team will never reach out to you in the app.")
50165017
}
50175018
/// external
50185019
internal static let partner = L10n.tr("Localizable", "profile.details.partner", fallback: "external")
50195020
/// Please verify the person's identity before accepting the connection request.
5020-
internal static let requestedIdentityWarning = L10n.tr("Localizable", "profile.details.requested_identity_warning", fallback: "Please verify the person's identity before accepting the connection request.")
5021+
/// Wire’s Support team will never reach out to you in the app.
5022+
internal static let requestedIdentityWarning = L10n.tr("Localizable", "profile.details.requested_identity_warning", fallback: "Please verify the person's identity before accepting the connection request.\nWire’s Support team will never reach out to you in the app.")
50215023
/// Details
50225024
internal static let title = L10n.tr("Localizable", "profile.details.title", fallback: "Details")
50235025
internal enum Title {

wire-ios/Wire-iOS/Resources/Localization/Base.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@
10631063
"profile.details.partner" = "external";
10641064
"profile.details.federated" = "Federated";
10651065
"profile.details.blocking_reason" = "This user is blocked due to legal hold. [LEARN MORE](%@)";
1066-
"profile.details.identity_warning" = "Get certainty about %@’s identity before connecting.";
1067-
"profile.details.requested_identity_warning" = "Please verify the person's identity before accepting the connection request.";
1066+
"profile.details.identity_warning" = "Get certainty about %@’s identity before connecting.\nWire’s Support team will never reach out to you in the app.";
1067+
"profile.details.requested_identity_warning" = "Please verify the person's identity before accepting the connection request.\nWire’s Support team will never reach out to you in the app.";
10681068
"profile.details.title.unavailable" = "Name not available";
10691069

10701070
// Device list

wire-ios/Wire-iOS/Sources/UserInterface/SelfProfile/WarningLabelView.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ import WireDataModel
2222
import WireDesign
2323

2424
final class WarningLabelView: UIView {
25-
private let stackView = UIStackView(axis: .horizontal)
26-
private let imageView = UIImageView(image: UIImage(named: "Info"))
25+
private let stackView = UIStackView(axis: .vertical)
2726

2827
private let label = DynamicFontLabel(
2928
style: .h5,
3029
color: SemanticColors.Label.textErrorDefault
3130
)
3231

32+
private static let paragraphStyle: NSParagraphStyle = {
33+
let style = NSMutableParagraphStyle()
34+
style.paragraphSpacing = 8
35+
style.alignment = .center
36+
return style
37+
}()
38+
3339
// MARK: - Setup
3440

3541
init() {
@@ -45,18 +51,12 @@ final class WarningLabelView: UIView {
4551
private func setupViews() {
4652
stackView.translatesAutoresizingMaskIntoConstraints = false
4753
addSubview(stackView)
48-
stackView.alignment = .top
54+
stackView.alignment = .center
4955
stackView.spacing = 10
50-
imageView.tintColor = SemanticColors.Icon.foregroundDefaultRed
51-
stackView.addArrangedSubview(imageView)
5256
label.numberOfLines = 0
5357
stackView.addArrangedSubview(label)
5458
NSLayoutConstraint.activate(
55-
[
56-
imageView.widthAnchor.constraint(equalToConstant: 16.0),
57-
imageView.heightAnchor.constraint(equalToConstant: 16.0)
58-
] +
59-
NSLayoutConstraint.forView(
59+
NSLayoutConstraint.forView(
6060
view: stackView,
6161
inContainer: self,
6262
withInsets: .zero
@@ -68,14 +68,17 @@ final class WarningLabelView: UIView {
6868
typealias profileDetails = L10n.Localizable.Profile.Details
6969
if user.isPendingApprovalBySelfUser {
7070
isHidden = false
71-
label.text = profileDetails.requestedIdentityWarning
71+
label.attributedText = attributedWarning(profileDetails.requestedIdentityWarning)
7272
}
7373
guard let name = user.name else {
7474
isHidden = true
7575
return
7676
}
7777
isHidden = user.isConnected || user.isTeamMember || user.isSelfUser
78-
label.text = profileDetails.identityWarning(name)
78+
label.attributedText = attributedWarning(profileDetails.identityWarning(name))
79+
}
7980

81+
private func attributedWarning(_ text: String) -> NSAttributedString {
82+
NSAttributedString(string: text, attributes: [.paragraphStyle: Self.paragraphStyle])
8083
}
8184
}

0 commit comments

Comments
 (0)