[WIP] Topics

This commit is contained in:
Ali
2022-10-14 16:36:00 +04:00
parent 42bd083a7f
commit e6de19ca14
35 changed files with 632 additions and 174 deletions

View File

@@ -684,7 +684,20 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
attributedString = NSAttributedString(string: "Topic created", font: titleFont, textColor: primaryTextColor)
case let .topicEdited(components):
//TODO:localize
if let title = components.compactMap({ item -> String? in
if let isClosed = components.compactMap({ item -> Bool? in
switch item {
case let .isClosed(isClosed):
return isClosed
default:
return nil
}
}).first {
if isClosed {
attributedString = NSAttributedString(string: "Topic closed", font: titleFont, textColor: primaryTextColor)
} else {
attributedString = NSAttributedString(string: "Topic restarted", font: titleFont, textColor: primaryTextColor)
}
} else if let title = components.compactMap({ item -> String? in
switch item {
case let .title(title):
return title