mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'dev' of https://github.com/loki-project/loki-messenger-ios into private-group-chat
This commit is contained in:
commit
997b894125
|
@ -33,6 +33,6 @@ final class Colors : NSObject {
|
||||||
@objc static let fakeChatBubbleText = UIColor(hex: 0x000000)
|
@objc static let fakeChatBubbleText = UIColor(hex: 0x000000)
|
||||||
@objc static let composeViewBackground = UIColor(hex: 0x1B1B1B)
|
@objc static let composeViewBackground = UIColor(hex: 0x1B1B1B)
|
||||||
@objc static let composeViewTextFieldBackground = UIColor(hex: 0x141414)
|
@objc static let composeViewTextFieldBackground = UIColor(hex: 0x141414)
|
||||||
@objc static let receivedMessageBackgroundColor = UIColor(hex: 0x222325)
|
@objc static let receivedMessageBackground = UIColor(hex: 0x222325)
|
||||||
@objc static let sentMessageBackgroundColor = UIColor(hex: 0x3F4146)
|
@objc static let sentMessageBackground = UIColor(hex: 0x3F4146)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1023,6 +1023,7 @@ const CGFloat kMaxTextViewHeight = 120;
|
||||||
self.linkPreviewView = linkPreviewView;
|
self.linkPreviewView = linkPreviewView;
|
||||||
|
|
||||||
self.linkPreviewWrapper.hidden = NO;
|
self.linkPreviewWrapper.hidden = NO;
|
||||||
|
self.linkPreviewWrapper.backgroundColor = LKColors.composeViewTextFieldBackground;
|
||||||
[self.linkPreviewWrapper addSubview:linkPreviewView];
|
[self.linkPreviewWrapper addSubview:linkPreviewView];
|
||||||
[linkPreviewView ows_autoPinToSuperviewMargins];
|
[linkPreviewView ows_autoPinToSuperviewMargins];
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,18 +516,18 @@ public class LinkPreviewView: UIStackView {
|
||||||
|
|
||||||
private let sentMinimumHeroSize: CGFloat = 200
|
private let sentMinimumHeroSize: CGFloat = 200
|
||||||
|
|
||||||
private let sentTitleFontSizePoints: CGFloat = 17
|
private let sentTitleFontSizePoints: CGFloat = Values.mediumFontSize
|
||||||
private let sentDomainFontSizePoints: CGFloat = 12
|
private let sentDomainFontSizePoints: CGFloat = Values.verySmallFontSize
|
||||||
private let sentVSpacing: CGFloat = 4
|
private let sentVSpacing: CGFloat = 4
|
||||||
|
|
||||||
// The "sent message" mode has two submodes: "hero" and "non-hero".
|
// The "sent message" mode has two submodes: "hero" and "non-hero".
|
||||||
private let sentNonHeroHMargin: CGFloat = 6
|
private let sentNonHeroHMargin: CGFloat = Values.mediumSpacing
|
||||||
private let sentNonHeroVMargin: CGFloat = 6
|
private let sentNonHeroVMargin: CGFloat = Values.mediumSpacing
|
||||||
private let sentNonHeroImageSize: CGFloat = 72
|
private let sentNonHeroImageSize: CGFloat = 72
|
||||||
private let sentNonHeroHSpacing: CGFloat = 8
|
private let sentNonHeroHSpacing: CGFloat = 8
|
||||||
|
|
||||||
private let sentHeroHMargin: CGFloat = 12
|
private let sentHeroHMargin: CGFloat = Values.mediumSpacing
|
||||||
private let sentHeroVMargin: CGFloat = 7
|
private let sentHeroVMargin: CGFloat = Values.mediumSpacing
|
||||||
|
|
||||||
private func sentIsHero(state: LinkPreviewSent) -> Bool {
|
private func sentIsHero(state: LinkPreviewSent) -> Bool {
|
||||||
let imageSize = state.imageSize
|
let imageSize = state.imageSize
|
||||||
|
@ -553,9 +553,9 @@ public class LinkPreviewView: UIStackView {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
if let displayDomain = state.displayDomain(),
|
if let displayDomain = state.displayDomain(),
|
||||||
displayDomain.count > 0 {
|
displayDomain.count > 0 {
|
||||||
label.text = displayDomain.uppercased()
|
label.text = displayDomain
|
||||||
} else {
|
} 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.font = UIFont.systemFont(ofSize: sentDomainFontSizePoints)
|
||||||
label.textColor = Theme.secondaryColor
|
label.textColor = Theme.secondaryColor
|
||||||
|
@ -571,7 +571,7 @@ public class LinkPreviewView: UIStackView {
|
||||||
self.distribution = .fill
|
self.distribution = .fill
|
||||||
self.spacing = 8
|
self.spacing = 8
|
||||||
self.isLayoutMarginsRelativeArrangement = true
|
self.isLayoutMarginsRelativeArrangement = true
|
||||||
|
|
||||||
self.layoutConstraints.append(self.autoSetDimension(.height, toSize: draftHeight + draftMarginTop))
|
self.layoutConstraints.append(self.autoSetDimension(.height, toSize: draftHeight + draftMarginTop))
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
|
@ -620,16 +620,16 @@ public class LinkPreviewView: UIStackView {
|
||||||
title.count > 0 {
|
title.count > 0 {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.text = title
|
label.text = title
|
||||||
label.textColor = Theme.primaryColor
|
label.textColor = Colors.text
|
||||||
label.font = UIFont.ows_dynamicTypeBody
|
label.font = .systemFont(ofSize: Values.mediumFontSize)
|
||||||
textStack.addArrangedSubview(label)
|
textStack.addArrangedSubview(label)
|
||||||
}
|
}
|
||||||
if let displayDomain = state.displayDomain(),
|
if let displayDomain = state.displayDomain(),
|
||||||
displayDomain.count > 0 {
|
displayDomain.count > 0 {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.text = displayDomain.uppercased()
|
label.text = displayDomain
|
||||||
label.textColor = Theme.secondaryColor
|
label.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity)
|
||||||
label.font = UIFont.ows_dynamicTypeCaption1
|
label.font = .systemFont(ofSize: Values.verySmallFontSize)
|
||||||
textStack.addArrangedSubview(label)
|
textStack.addArrangedSubview(label)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,17 +146,17 @@ public class ConversationStyle: NSObject {
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
private static var defaultBubbleColorIncoming: UIColor {
|
private static var defaultBubbleColorIncoming: UIColor {
|
||||||
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackgroundColor
|
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
public let dateBreakTextColor = UIColor.ows_gray60
|
public let dateBreakTextColor = UIColor.ows_gray60
|
||||||
|
@ -228,9 +228,9 @@ public class ConversationStyle: NSObject {
|
||||||
@objc
|
@objc
|
||||||
public func quotedReplyBubbleColor(isIncoming: Bool) -> UIColor {
|
public func quotedReplyBubbleColor(isIncoming: Bool) -> UIColor {
|
||||||
if isIncoming {
|
if isIncoming {
|
||||||
return UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
return UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackground
|
||||||
} else {
|
} else {
|
||||||
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackgroundColor
|
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackground
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ final class LokiPushNotificationManager : NSObject {
|
||||||
print("Registering device token: (\(hexEncodedToken))")
|
print("Registering device token: (\(hexEncodedToken))")
|
||||||
// Send token to Loki server
|
// Send token to Loki server
|
||||||
let parameters = [ "token" : hexEncodedToken ]
|
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)
|
let request = TSRequest(url: url, method: "POST", parameters: parameters)
|
||||||
request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ]
|
request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ]
|
||||||
TSNetworkManager.shared().makeRequest(request, success: { _, response in
|
TSNetworkManager.shared().makeRequest(request, success: { _, response in
|
||||||
|
|
Loading…
Reference in a new issue