From 0c94915a981c81a099c23aad13aad3b2c385b2c4 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Mon, 13 Jan 2020 14:03:49 +1100 Subject: [PATCH 1/2] change to new ssl hostname for registering toke to our server --- .../xcschemes/Signal-Internal.xcscheme | 16 ++++++---------- .../xcshareddata/xcschemes/Signal.xcscheme | 8 ++++---- .../xcschemes/SignalShareExtension.xcscheme | 15 ++++++--------- .../Loki/API/LokiPushNotificationManager.swift | 2 +- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme index ee18275a3..f87c0c2a8 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme @@ -15,7 +15,7 @@ @@ -27,19 +27,17 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + @@ -73,8 +71,6 @@ isEnabled = "YES"> - - diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme index 76ee62c7b..1306a2ff8 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme @@ -15,7 +15,7 @@ @@ -45,7 +45,7 @@ @@ -149,7 +149,7 @@ @@ -188,7 +188,7 @@ diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme index 859263a4d..f708fe73a 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme @@ -30,7 +30,7 @@ @@ -42,8 +42,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - diff --git a/SignalServiceKit/src/Loki/API/LokiPushNotificationManager.swift b/SignalServiceKit/src/Loki/API/LokiPushNotificationManager.swift index f4a16fe9d..7e1eb0fdc 100644 --- a/SignalServiceKit/src/Loki/API/LokiPushNotificationManager.swift +++ b/SignalServiceKit/src/Loki/API/LokiPushNotificationManager.swift @@ -13,7 +13,7 @@ final class LokiPushNotificationManager : NSObject { print("Registering device token: (\(hexEncodedToken))") // Send token to Loki server let parameters = [ "token" : hexEncodedToken ] - let url = URL(string: "http://88.99.14.72:5000/register")! + let url = URL(string: "https://live.apns.getsession.org/register")! let request = TSRequest(url: url, method: "POST", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ] TSNetworkManager.shared().makeRequest(request, success: { _, response in From 6d0f2c958cdcc5df39ae9c4e508ebf8d32f1d9da Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 13 Jan 2020 15:50:30 +1100 Subject: [PATCH 2/2] Clean up link previews --- Signal/src/Loki/Style Guide/Colors.swift | 4 +-- .../ConversationInputToolbar.m | 1 + Signal/src/views/LinkPreviewView.swift | 28 +++++++++---------- SignalMessaging/utils/ConversationStyle.swift | 12 ++++---- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Signal/src/Loki/Style Guide/Colors.swift b/Signal/src/Loki/Style Guide/Colors.swift index 54e6ac3e0..ee7d5c8e8 100644 --- a/Signal/src/Loki/Style Guide/Colors.swift +++ b/Signal/src/Loki/Style Guide/Colors.swift @@ -33,6 +33,6 @@ final class Colors : NSObject { @objc static let fakeChatBubbleText = UIColor(hex: 0x000000) @objc static let composeViewBackground = UIColor(hex: 0x1B1B1B) @objc static let composeViewTextFieldBackground = UIColor(hex: 0x141414) - @objc static let receivedMessageBackgroundColor = UIColor(hex: 0x222325) - @objc static let sentMessageBackgroundColor = UIColor(hex: 0x3F4146) + @objc static let receivedMessageBackground = UIColor(hex: 0x222325) + @objc static let sentMessageBackground = UIColor(hex: 0x3F4146) } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index e41f16306..bc2af17b5 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -1023,6 +1023,7 @@ const CGFloat kMaxTextViewHeight = 120; self.linkPreviewView = linkPreviewView; self.linkPreviewWrapper.hidden = NO; + self.linkPreviewWrapper.backgroundColor = LKColors.composeViewTextFieldBackground; [self.linkPreviewWrapper addSubview:linkPreviewView]; [linkPreviewView ows_autoPinToSuperviewMargins]; } diff --git a/Signal/src/views/LinkPreviewView.swift b/Signal/src/views/LinkPreviewView.swift index 5be7ca83f..2ded0ad1f 100644 --- a/Signal/src/views/LinkPreviewView.swift +++ b/Signal/src/views/LinkPreviewView.swift @@ -516,18 +516,18 @@ public class LinkPreviewView: UIStackView { private let sentMinimumHeroSize: CGFloat = 200 - private let sentTitleFontSizePoints: CGFloat = 17 - private let sentDomainFontSizePoints: CGFloat = 12 + private let sentTitleFontSizePoints: CGFloat = Values.mediumFontSize + private let sentDomainFontSizePoints: CGFloat = Values.verySmallFontSize private let sentVSpacing: CGFloat = 4 // The "sent message" mode has two submodes: "hero" and "non-hero". - private let sentNonHeroHMargin: CGFloat = 6 - private let sentNonHeroVMargin: CGFloat = 6 + private let sentNonHeroHMargin: CGFloat = Values.mediumSpacing + private let sentNonHeroVMargin: CGFloat = Values.mediumSpacing private let sentNonHeroImageSize: CGFloat = 72 private let sentNonHeroHSpacing: CGFloat = 8 - private let sentHeroHMargin: CGFloat = 12 - private let sentHeroVMargin: CGFloat = 7 + private let sentHeroHMargin: CGFloat = Values.mediumSpacing + private let sentHeroVMargin: CGFloat = Values.mediumSpacing private func sentIsHero(state: LinkPreviewSent) -> Bool { let imageSize = state.imageSize @@ -553,9 +553,9 @@ public class LinkPreviewView: UIStackView { let label = UILabel() if let displayDomain = state.displayDomain(), displayDomain.count > 0 { - label.text = displayDomain.uppercased() + label.text = displayDomain } else { - label.text = NSLocalizedString("LINK_PREVIEW_UNKNOWN_DOMAIN", comment: "Label for link previews with an unknown host.").uppercased() + label.text = NSLocalizedString("LINK_PREVIEW_UNKNOWN_DOMAIN", comment: "Label for link previews with an unknown host.") } label.font = UIFont.systemFont(ofSize: sentDomainFontSizePoints) label.textColor = Theme.secondaryColor @@ -571,7 +571,7 @@ public class LinkPreviewView: UIStackView { self.distribution = .fill self.spacing = 8 self.isLayoutMarginsRelativeArrangement = true - + self.layoutConstraints.append(self.autoSetDimension(.height, toSize: draftHeight + draftMarginTop)) // Image @@ -620,16 +620,16 @@ public class LinkPreviewView: UIStackView { title.count > 0 { let label = UILabel() label.text = title - label.textColor = Theme.primaryColor - label.font = UIFont.ows_dynamicTypeBody + label.textColor = Colors.text + label.font = .systemFont(ofSize: Values.mediumFontSize) textStack.addArrangedSubview(label) } if let displayDomain = state.displayDomain(), displayDomain.count > 0 { let label = UILabel() - label.text = displayDomain.uppercased() - label.textColor = Theme.secondaryColor - label.font = UIFont.ows_dynamicTypeCaption1 + label.text = displayDomain + label.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity) + label.font = .systemFont(ofSize: Values.verySmallFontSize) textStack.addArrangedSubview(label) } diff --git a/SignalMessaging/utils/ConversationStyle.swift b/SignalMessaging/utils/ConversationStyle.swift index fc712b02f..ae77e63b1 100644 --- a/SignalMessaging/utils/ConversationStyle.swift +++ b/SignalMessaging/utils/ConversationStyle.swift @@ -146,17 +146,17 @@ public class ConversationStyle: NSObject { @objc private static var defaultBubbleColorIncoming: UIColor { - return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackgroundColor + return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground } @objc - public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor + public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground @objc - public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor + public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground @objc - public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor + public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground @objc public let dateBreakTextColor = UIColor.ows_gray60 @@ -228,9 +228,9 @@ public class ConversationStyle: NSObject { @objc public func quotedReplyBubbleColor(isIncoming: Bool) -> UIColor { if isIncoming { - return UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor + return UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground } else { - return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackgroundColor + return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground } }