Various improvements

This commit is contained in:
Isaac
2023-12-21 23:36:38 +04:00
parent 2e666c5c2b
commit 21866185a8
13 changed files with 203 additions and 81 deletions

View File

@@ -51,6 +51,7 @@ public struct Namespaces {
public static let CloudEmojiGenericAnimations: Int32 = 9
public static let CloudIconStatusEmoji: Int32 = 10
public static let CloudIconTopicEmoji: Int32 = 11
public static let CloudIconChannelStatusEmoji: Int32 = 12
}
public struct OrderedItemList {
@@ -81,6 +82,8 @@ public struct Namespaces {
public static let CloudFeaturedGroupPhotoEmoji: Int32 = 24
public static let NewSessionReviews: Int32 = 25
public static let CloudFeaturedBackgroundIconEmoji: Int32 = 26
public static let CloudFeaturedChannelStatusEmoji: Int32 = 27
public static let CloudDisabledChannelStatusEmoji: Int32 = 28
}
public struct CachedItemCollection {

View File

@@ -23,24 +23,27 @@ public enum StickerPackReference: PostboxCoding, Hashable, Equatable, Codable {
case emojiGenericAnimations
case iconStatusEmoji
case iconTopicEmoji
case iconChannelStatusEmoji
public init(decoder: PostboxDecoder) {
switch decoder.decodeInt32ForKey("r", orElse: 0) {
case 0:
self = .id(id: decoder.decodeInt64ForKey("i", orElse: 0), accessHash: decoder.decodeInt64ForKey("h", orElse: 0))
case 1:
self = .name(decoder.decodeStringForKey("n", orElse: ""))
case 2:
self = .animatedEmoji
case 3:
self = .dice(decoder.decodeStringForKey("e", orElse: "🎲"))
case 4:
self = .animatedEmojiAnimations
case 5:
self = .premiumGifts
default:
self = .name("")
assertionFailure()
case 0:
self = .id(id: decoder.decodeInt64ForKey("i", orElse: 0), accessHash: decoder.decodeInt64ForKey("h", orElse: 0))
case 1:
self = .name(decoder.decodeStringForKey("n", orElse: ""))
case 2:
self = .animatedEmoji
case 3:
self = .dice(decoder.decodeStringForKey("e", orElse: "🎲"))
case 4:
self = .animatedEmojiAnimations
case 5:
self = .premiumGifts
case 6:
self = .iconChannelStatusEmoji
default:
self = .name("")
assertionFailure()
}
}
@@ -61,6 +64,8 @@ public enum StickerPackReference: PostboxCoding, Hashable, Equatable, Codable {
self = .animatedEmojiAnimations
case 5:
self = .premiumGifts
case 6:
self = .iconChannelStatusEmoji
default:
self = .name("")
assertionFailure()
@@ -85,7 +90,7 @@ public enum StickerPackReference: PostboxCoding, Hashable, Equatable, Codable {
encoder.encodeInt32(4, forKey: "r")
case .premiumGifts:
encoder.encodeInt32(5, forKey: "r")
case .emojiGenericAnimations, .iconStatusEmoji, .iconTopicEmoji:
case .emojiGenericAnimations, .iconStatusEmoji, .iconTopicEmoji, .iconChannelStatusEmoji:
preconditionFailure()
}
}
@@ -110,7 +115,7 @@ public enum StickerPackReference: PostboxCoding, Hashable, Equatable, Codable {
try container.encode(4 as Int32, forKey: "r")
case .premiumGifts:
try container.encode(5 as Int32, forKey: "r")
case .emojiGenericAnimations, .iconStatusEmoji, .iconTopicEmoji:
case .emojiGenericAnimations, .iconStatusEmoji, .iconTopicEmoji, .iconChannelStatusEmoji:
preconditionFailure()
}
}
@@ -171,6 +176,12 @@ public enum StickerPackReference: PostboxCoding, Hashable, Equatable, Codable {
} else {
return false
}
case .iconChannelStatusEmoji:
if case .iconChannelStatusEmoji = rhs {
return true
} else {
return false
}
}
}
}