|
|
@ -159,13 +159,6 @@ final class ConversationTitleView : UIView {
|
|
|
|
@objc func updateSubtitleForCurrentStatus() {
|
|
|
|
@objc func updateSubtitleForCurrentStatus() {
|
|
|
|
DispatchQueue.main.async {
|
|
|
|
DispatchQueue.main.async {
|
|
|
|
self.subtitleLabel.isHidden = false
|
|
|
|
self.subtitleLabel.isHidden = false
|
|
|
|
switch self.currentStatus {
|
|
|
|
|
|
|
|
case .calculatingPoW: self.subtitleLabel.text = NSLocalizedString("Encrypting message", comment: "")
|
|
|
|
|
|
|
|
case .routing: self.subtitleLabel.text = NSLocalizedString("Tracing a path", comment: "")
|
|
|
|
|
|
|
|
case .messageSending: self.subtitleLabel.text = NSLocalizedString("Sending message", comment: "")
|
|
|
|
|
|
|
|
case .messageSent: self.subtitleLabel.text = NSLocalizedString("Message sent securely", comment: "")
|
|
|
|
|
|
|
|
case .messageFailed: self.subtitleLabel.text = NSLocalizedString("Message failed to send", comment: "")
|
|
|
|
|
|
|
|
case nil:
|
|
|
|
|
|
|
|
let subtitle = NSMutableAttributedString()
|
|
|
|
let subtitle = NSMutableAttributedString()
|
|
|
|
if let muteEndDate = self.thread.mutedUntilDate, self.thread.isMuted {
|
|
|
|
if let muteEndDate = self.thread.mutedUntilDate, self.thread.isMuted {
|
|
|
|
subtitle.append(NSAttributedString(string: "\u{e067} ", attributes: [ .font : UIFont.ows_elegantIconsFont(10), .foregroundColor : Colors.unimportant ]))
|
|
|
|
subtitle.append(NSAttributedString(string: "\u{e067} ", attributes: [ .font : UIFont.ows_elegantIconsFont(10), .foregroundColor : Colors.unimportant ]))
|
|
|
@ -193,13 +186,11 @@ final class ConversationTitleView : UIView {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
self.subtitleLabel.isHidden = true
|
|
|
|
self.subtitleLabel.isHidden = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if let hexEncodedPublicKey = (self.thread as? TSContactThread)?.contactIdentifier(), ECKeyPair.isValidHexEncodedPublicKey(candidate: hexEncodedPublicKey) {
|
|
|
|
}
|
|
|
|
subtitle.append(NSAttributedString(string: hexEncodedPublicKey))
|
|
|
|
else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
self.subtitleLabel.isHidden = true
|
|
|
|
self.subtitleLabel.isHidden = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self.subtitleLabel.attributedText = subtitle
|
|
|
|
self.subtitleLabel.attributedText = subtitle
|
|
|
|
}
|
|
|
|
|
|
|
|
self.titleLabel.font = .boldSystemFont(ofSize: self.subtitleLabel.isHidden ? Values.veryLargeFontSize : Values.mediumFontSize)
|
|
|
|
self.titleLabel.font = .boldSystemFont(ofSize: self.subtitleLabel.isHidden ? Values.veryLargeFontSize : Values.mediumFontSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|