add only notify mentions subtitle in conversation creen

pull/474/head
ryanzhao 4 years ago
parent b5d1ccdbc3
commit 0181b57f1a

@ -86,12 +86,21 @@ final class ConversationTitleView : UIView {
} }
private func getSubtitle() -> NSAttributedString? { private func getSubtitle() -> NSAttributedString? {
if thread.isMuted {
let result = NSMutableAttributedString() let result = NSMutableAttributedString()
if thread.isMuted {
result.append(NSAttributedString(string: "\u{e067} ", attributes: [ .font : UIFont.ows_elegantIconsFont(10), .foregroundColor : Colors.text ])) result.append(NSAttributedString(string: "\u{e067} ", attributes: [ .font : UIFont.ows_elegantIconsFont(10), .foregroundColor : Colors.text ]))
result.append(NSAttributedString(string: "Muted")) result.append(NSAttributedString(string: "Muted"))
return result return result
} else if let thread = self.thread as? TSGroupThread { } else if let thread = self.thread as? TSGroupThread {
if thread.isOnlyNotifyMentions {
let imageAttachment = NSTextAttachment()
imageAttachment.image = UIImage(named: "NotifyMentions.png")?.asTintedImage(color: Colors.text)
imageAttachment.bounds = CGRect(x: 0, y: -2, width: Values.smallFontSize, height: Values.smallFontSize)
let imageString = NSAttributedString(attachment: imageAttachment)
result.append(imageString)
result.append(NSAttributedString(string: " Only Notify Mentions"))
return result
} else {
var userCount: UInt64? var userCount: UInt64?
switch thread.groupModel.groupType { switch thread.groupModel.groupType {
case .closedGroup: userCount = UInt64(thread.groupModel.groupMemberIds.count) case .closedGroup: userCount = UInt64(thread.groupModel.groupMemberIds.count)
@ -104,6 +113,7 @@ final class ConversationTitleView : UIView {
return NSAttributedString(string: "\(userCount) members") return NSAttributedString(string: "\(userCount) members")
} }
} }
}
return nil return nil
} }

Loading…
Cancel
Save