Skip to content

Commit 6ee7458

Browse files
committed
Feat: add warning to connection requests
1 parent 28246f7 commit 6ee7458

9 files changed

Lines changed: 32 additions & 18 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: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@ import WireDataModel
2222
import WireDesign
2323

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

2828
private let label = DynamicFontLabel(
2929
style: .h5,
3030
color: SemanticColors.Label.textErrorDefault
3131
)
3232

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

3542
init() {
@@ -45,7 +52,7 @@ final class WarningLabelView: UIView {
4552
private func setupViews() {
4653
stackView.translatesAutoresizingMaskIntoConstraints = false
4754
addSubview(stackView)
48-
stackView.alignment = .top
55+
stackView.alignment = .center
4956
stackView.spacing = 10
5057
imageView.tintColor = SemanticColors.Icon.foregroundDefaultRed
5158
stackView.addArrangedSubview(imageView)
@@ -68,14 +75,17 @@ final class WarningLabelView: UIView {
6875
typealias profileDetails = L10n.Localizable.Profile.Details
6976
if user.isPendingApprovalBySelfUser {
7077
isHidden = false
71-
label.text = profileDetails.requestedIdentityWarning
78+
label.attributedText = attributedWarning(profileDetails.requestedIdentityWarning)
7279
}
7380
guard let name = user.name else {
7481
isHidden = true
7582
return
7683
}
7784
isHidden = user.isConnected || user.isTeamMember || user.isSelfUser
78-
label.text = profileDetails.identityWarning(name)
85+
label.attributedText = attributedWarning(profileDetails.identityWarning(name))
86+
}
7987

88+
private func attributedWarning(_ text: String) -> NSAttributedString {
89+
NSAttributedString(string: text, attributes: [.paragraphStyle: Self.paragraphStyle])
8090
}
8191
}

0 commit comments

Comments
 (0)