Various fixes

This commit is contained in:
Ilya Laktyushin
2023-10-12 15:39:47 +04:00
parent b80f2636d6
commit 4013fca50e
16 changed files with 66 additions and 14 deletions

View File

@@ -26,6 +26,7 @@ public enum MessageContentKindKey {
case dice
case invoice
case story
case giveaway
}
public enum MessageContentKind: Equatable {
@@ -48,6 +49,7 @@ public enum MessageContentKind: Equatable {
case dice(String)
case invoice(String)
case story
case giveaway
public func isSemanticallyEqual(to other: MessageContentKind) -> Bool {
switch self {
@@ -165,6 +167,12 @@ public enum MessageContentKind: Equatable {
} else {
return false
}
case .giveaway:
if case .giveaway = other {
return true
} else {
return false
}
}
}
@@ -208,6 +216,8 @@ public enum MessageContentKind: Equatable {
return .invoice
case .story:
return .story
case .giveaway:
return .giveaway
}
}
}
@@ -397,6 +407,8 @@ public func stringForMediaKind(_ kind: MessageContentKind, strings: Presentation
return (NSAttributedString(string: text), true)
case .story:
return (NSAttributedString(string: strings.Message_Story), true)
case .giveaway:
return (NSAttributedString(string: strings.Message_Giveaway), true)
}
}