Cherry-pick fixes

This commit is contained in:
Ilya Laktyushin
2022-10-05 17:48:27 +03:00
parent f3beb09f35
commit bca77cd025
65 changed files with 1537 additions and 288 deletions

View File

@@ -47,6 +47,119 @@ public enum MessageContentKind: Equatable {
case dice(String)
case invoice(String)
public func isSemanticallyEqual(to other: MessageContentKind) -> Bool {
switch self {
case .text:
if case .text = other {
return true
} else {
return false
}
case .image:
if case .image = other {
return true
} else {
return false
}
case .video:
if case .video = other {
return true
} else {
return false
}
case .videoMessage:
if case .videoMessage = other {
return true
} else {
return false
}
case .audioMessage:
if case .audioMessage = other {
return true
} else {
return false
}
case .sticker:
if case .sticker = other {
return true
} else {
return false
}
case .animation:
if case .animation = other {
return true
} else {
return false
}
case .file:
if case .file = other {
return true
} else {
return false
}
case .contact:
if case .contact = other {
return true
} else {
return false
}
case .game:
if case .game = other {
return true
} else {
return false
}
case .location:
if case .location = other {
return true
} else {
return false
}
case .liveLocation:
if case .liveLocation = other {
return true
} else {
return false
}
case .expiredImage:
if case .expiredImage = other {
return true
} else {
return false
}
case .expiredVideo:
if case .expiredVideo = other {
return true
} else {
return false
}
case .poll:
if case .poll = other {
return true
} else {
return false
}
case .restricted:
if case .restricted = other {
return true
} else {
return false
}
case .dice:
if case .dice = other {
return true
} else {
return false
}
case .invoice:
if case .invoice = other {
return true
} else {
return false
}
}
}
public var key: MessageContentKindKey {
switch self {
case .text: