mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-04-07 13:47:54 +00:00
Version 10.13
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user