Version 10.13

This commit is contained in:
Kylmakalle
2024-07-02 19:58:37 +03:00
parent 1d1ea447ad
commit 1cfbc5b7cd
634 changed files with 30999 additions and 1244 deletions

View File

@@ -193,3 +193,32 @@ public func roundDateToDays(_ timestamp: Int32) -> Int32 {
}
return Int32(date.timeIntervalSince1970)
}
// MARK: Swiftgram
public func stringForDateWithoutDay(date: Date, timeZone: TimeZone? = TimeZone(secondsFromGMT: 0), strings: PresentationStrings) -> String {
let formatter = DateFormatter()
formatter.timeStyle = .none
formatter.timeZone = timeZone
formatter.locale = localeWithStrings(strings)
formatter.setLocalizedDateFormatFromTemplate("MMMMyyyy")
return formatter.string(from: date)
}
public func stringForDateWithoutDayAndMonth(date: Date, timeZone: TimeZone? = TimeZone(secondsFromGMT: 0), strings: PresentationStrings) -> String {
let formatter = DateFormatter()
formatter.timeStyle = .none
formatter.timeZone = timeZone
formatter.locale = localeWithStrings(strings)
formatter.setLocalizedDateFormatFromTemplate("yyyy")
return formatter.string(from: date)
}

View File

@@ -49,6 +49,9 @@ public func flagEmoji(countryCode: String) -> String {
if countryCode.uppercased() == "FT" {
return "🏴‍☠️"
}
if countryCode.uppercased() == "XX" {
return "🏳️"
}
let base : UInt32 = 127397
var flagString = ""
for v in countryCode.uppercased().unicodeScalars {

View File

@@ -279,7 +279,7 @@ public func messageTextWithAttributes(message: EngineMessage) -> NSAttributedStr
public func messageContentKind(contentSettings: ContentSettings, message: EngineMessage, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, accountPeerId: EnginePeer.Id) -> MessageContentKind {
for attribute in message.attributes {
if let attribute = attribute as? RestrictedContentMessageAttribute {
if let text = attribute.platformText(platform: "ios", contentSettings: contentSettings) {
if let text = attribute.platformText(platform: "ios", contentSettings: contentSettings, chatId: message.author?.id.id._internalGetInt64Value()) {
return .restricted(text)
}
break