Skip to content

Commit bbef110

Browse files
committed
Update API
1 parent 144516e commit bbef110

7 files changed

Lines changed: 110 additions & 32 deletions

File tree

‎submodules/TelegramApi/Sources/Api0.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
959959
dict[1124938064] = { return Api.SponsoredMessageReportOption.parse_sponsoredMessageReportOption($0) }
960960
dict[-963180333] = { return Api.SponsoredPeer.parse_sponsoredPeer($0) }
961961
dict[-2136190013] = { return Api.StarGift.parse_starGift($0) }
962-
dict[648369470] = { return Api.StarGift.parse_starGiftUnique($0) }
962+
dict[468707429] = { return Api.StarGift.parse_starGiftUnique($0) }
963963
dict[-650279524] = { return Api.StarGiftAttribute.parse_starGiftAttributeBackdrop($0) }
964964
dict[970559507] = { return Api.StarGiftAttribute.parse_starGiftAttributeModel($0) }
965965
dict[-524291476] = { return Api.StarGiftAttribute.parse_starGiftAttributeOriginalDetails($0) }
@@ -1230,7 +1230,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
12301230
dict[1674235686] = { return Api.account.AutoDownloadSettings.parse_autoDownloadSettings($0) }
12311231
dict[1279133341] = { return Api.account.AutoSaveSettings.parse_autoSaveSettings($0) }
12321232
dict[-331111727] = { return Api.account.BusinessChatLinks.parse_businessChatLinks($0) }
1233-
dict[1271855483] = { return Api.account.ChatThemes.parse_chatThemes($0) }
1233+
dict[373835863] = { return Api.account.ChatThemes.parse_chatThemes($0) }
12341234
dict[-535699004] = { return Api.account.ChatThemes.parse_chatThemesNotModified($0) }
12351235
dict[400029819] = { return Api.account.ConnectedBots.parse_connectedBots($0) }
12361236
dict[1474462241] = { return Api.account.ContentSettings.parse_contentSettings($0) }

‎submodules/TelegramApi/Sources/Api25.swift‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public extension Api {
289289
public extension Api {
290290
enum StarGift: TypeConstructorDescription {
291291
case starGift(flags: Int32, id: Int64, sticker: Api.Document, stars: Int64, availabilityRemains: Int32?, availabilityTotal: Int32?, availabilityResale: Int64?, convertStars: Int64, firstSaleDate: Int32?, lastSaleDate: Int32?, upgradeStars: Int64?, resellMinStars: Int64?, title: String?, releasedBy: Api.Peer?, perUserTotal: Int32?, perUserRemains: Int32?, lockedUntilDate: Int32?)
292-
case starGiftUnique(flags: Int32, id: Int64, giftId: Int64, title: String, slug: String, num: Int32, ownerId: Api.Peer?, ownerName: String?, ownerAddress: String?, attributes: [Api.StarGiftAttribute], availabilityIssued: Int32, availabilityTotal: Int32, giftAddress: String?, resellAmount: [Api.StarsAmount]?, releasedBy: Api.Peer?, valueAmount: Int64?, valueCurrency: String?)
292+
case starGiftUnique(flags: Int32, id: Int64, giftId: Int64, title: String, slug: String, num: Int32, ownerId: Api.Peer?, ownerName: String?, ownerAddress: String?, attributes: [Api.StarGiftAttribute], availabilityIssued: Int32, availabilityTotal: Int32, giftAddress: String?, resellAmount: [Api.StarsAmount]?, releasedBy: Api.Peer?, valueAmount: Int64?, valueCurrency: String?, themePeer: Api.Peer?)
293293

294294
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
295295
switch self {
@@ -315,9 +315,9 @@ public extension Api {
315315
if Int(flags) & Int(1 << 8) != 0 {serializeInt32(perUserRemains!, buffer: buffer, boxed: false)}
316316
if Int(flags) & Int(1 << 9) != 0 {serializeInt32(lockedUntilDate!, buffer: buffer, boxed: false)}
317317
break
318-
case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency):
318+
case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency, let themePeer):
319319
if boxed {
320-
buffer.appendInt32(648369470)
320+
buffer.appendInt32(468707429)
321321
}
322322
serializeInt32(flags, buffer: buffer, boxed: false)
323323
serializeInt64(id, buffer: buffer, boxed: false)
@@ -344,6 +344,7 @@ public extension Api {
344344
if Int(flags) & Int(1 << 5) != 0 {releasedBy!.serialize(buffer, true)}
345345
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(valueAmount!, buffer: buffer, boxed: false)}
346346
if Int(flags) & Int(1 << 8) != 0 {serializeString(valueCurrency!, buffer: buffer, boxed: false)}
347+
if Int(flags) & Int(1 << 10) != 0 {themePeer!.serialize(buffer, true)}
347348
break
348349
}
349350
}
@@ -352,8 +353,8 @@ public extension Api {
352353
switch self {
353354
case .starGift(let flags, let id, let sticker, let stars, let availabilityRemains, let availabilityTotal, let availabilityResale, let convertStars, let firstSaleDate, let lastSaleDate, let upgradeStars, let resellMinStars, let title, let releasedBy, let perUserTotal, let perUserRemains, let lockedUntilDate):
354355
return ("starGift", [("flags", flags as Any), ("id", id as Any), ("sticker", sticker as Any), ("stars", stars as Any), ("availabilityRemains", availabilityRemains as Any), ("availabilityTotal", availabilityTotal as Any), ("availabilityResale", availabilityResale as Any), ("convertStars", convertStars as Any), ("firstSaleDate", firstSaleDate as Any), ("lastSaleDate", lastSaleDate as Any), ("upgradeStars", upgradeStars as Any), ("resellMinStars", resellMinStars as Any), ("title", title as Any), ("releasedBy", releasedBy as Any), ("perUserTotal", perUserTotal as Any), ("perUserRemains", perUserRemains as Any), ("lockedUntilDate", lockedUntilDate as Any)])
355-
case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency):
356-
return ("starGiftUnique", [("flags", flags as Any), ("id", id as Any), ("giftId", giftId as Any), ("title", title as Any), ("slug", slug as Any), ("num", num as Any), ("ownerId", ownerId as Any), ("ownerName", ownerName as Any), ("ownerAddress", ownerAddress as Any), ("attributes", attributes as Any), ("availabilityIssued", availabilityIssued as Any), ("availabilityTotal", availabilityTotal as Any), ("giftAddress", giftAddress as Any), ("resellAmount", resellAmount as Any), ("releasedBy", releasedBy as Any), ("valueAmount", valueAmount as Any), ("valueCurrency", valueCurrency as Any)])
356+
case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency, let themePeer):
357+
return ("starGiftUnique", [("flags", flags as Any), ("id", id as Any), ("giftId", giftId as Any), ("title", title as Any), ("slug", slug as Any), ("num", num as Any), ("ownerId", ownerId as Any), ("ownerName", ownerName as Any), ("ownerAddress", ownerAddress as Any), ("attributes", attributes as Any), ("availabilityIssued", availabilityIssued as Any), ("availabilityTotal", availabilityTotal as Any), ("giftAddress", giftAddress as Any), ("resellAmount", resellAmount as Any), ("releasedBy", releasedBy as Any), ("valueAmount", valueAmount as Any), ("valueCurrency", valueCurrency as Any), ("themePeer", themePeer as Any)])
357358
}
358359
}
359360

@@ -463,6 +464,10 @@ public extension Api {
463464
if Int(_1!) & Int(1 << 8) != 0 {_16 = reader.readInt64() }
464465
var _17: String?
465466
if Int(_1!) & Int(1 << 8) != 0 {_17 = parseString(reader) }
467+
var _18: Api.Peer?
468+
if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() {
469+
_18 = Api.parse(reader, signature: signature) as? Api.Peer
470+
} }
466471
let _c1 = _1 != nil
467472
let _c2 = _2 != nil
468473
let _c3 = _3 != nil
@@ -480,8 +485,9 @@ public extension Api {
480485
let _c15 = (Int(_1!) & Int(1 << 5) == 0) || _15 != nil
481486
let _c16 = (Int(_1!) & Int(1 << 8) == 0) || _16 != nil
482487
let _c17 = (Int(_1!) & Int(1 << 8) == 0) || _17 != nil
483-
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 {
484-
return Api.StarGift.starGiftUnique(flags: _1!, id: _2!, giftId: _3!, title: _4!, slug: _5!, num: _6!, ownerId: _7, ownerName: _8, ownerAddress: _9, attributes: _10!, availabilityIssued: _11!, availabilityTotal: _12!, giftAddress: _13, resellAmount: _14, releasedBy: _15, valueAmount: _16, valueCurrency: _17)
488+
let _c18 = (Int(_1!) & Int(1 << 10) == 0) || _18 != nil
489+
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 {
490+
return Api.StarGift.starGiftUnique(flags: _1!, id: _2!, giftId: _3!, title: _4!, slug: _5!, num: _6!, ownerId: _7, ownerName: _8, ownerAddress: _9, attributes: _10!, availabilityIssued: _11!, availabilityTotal: _12!, giftAddress: _13, resellAmount: _14, releasedBy: _15, valueAmount: _16, valueCurrency: _17, themePeer: _18)
485491
}
486492
else {
487493
return nil

‎submodules/TelegramApi/Sources/Api29.swift‎

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,14 @@ public extension Api.account {
570570
}
571571
public extension Api.account {
572572
enum ChatThemes: TypeConstructorDescription {
573-
case chatThemes(flags: Int32, hash: Int64, themes: [Api.ChatTheme], nextOffset: Int32?)
573+
case chatThemes(flags: Int32, hash: Int64, themes: [Api.ChatTheme], chats: [Api.Chat], users: [Api.User], nextOffset: Int32?)
574574
case chatThemesNotModified
575575

576576
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
577577
switch self {
578-
case .chatThemes(let flags, let hash, let themes, let nextOffset):
578+
case .chatThemes(let flags, let hash, let themes, let chats, let users, let nextOffset):
579579
if boxed {
580-
buffer.appendInt32(1271855483)
580+
buffer.appendInt32(373835863)
581581
}
582582
serializeInt32(flags, buffer: buffer, boxed: false)
583583
serializeInt64(hash, buffer: buffer, boxed: false)
@@ -586,6 +586,16 @@ public extension Api.account {
586586
for item in themes {
587587
item.serialize(buffer, true)
588588
}
589+
buffer.appendInt32(481674261)
590+
buffer.appendInt32(Int32(chats.count))
591+
for item in chats {
592+
item.serialize(buffer, true)
593+
}
594+
buffer.appendInt32(481674261)
595+
buffer.appendInt32(Int32(users.count))
596+
for item in users {
597+
item.serialize(buffer, true)
598+
}
589599
if Int(flags) & Int(1 << 0) != 0 {serializeInt32(nextOffset!, buffer: buffer, boxed: false)}
590600
break
591601
case .chatThemesNotModified:
@@ -599,8 +609,8 @@ public extension Api.account {
599609

600610
public func descriptionFields() -> (String, [(String, Any)]) {
601611
switch self {
602-
case .chatThemes(let flags, let hash, let themes, let nextOffset):
603-
return ("chatThemes", [("flags", flags as Any), ("hash", hash as Any), ("themes", themes as Any), ("nextOffset", nextOffset as Any)])
612+
case .chatThemes(let flags, let hash, let themes, let chats, let users, let nextOffset):
613+
return ("chatThemes", [("flags", flags as Any), ("hash", hash as Any), ("themes", themes as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)])
604614
case .chatThemesNotModified:
605615
return ("chatThemesNotModified", [])
606616
}
@@ -615,14 +625,24 @@ public extension Api.account {
615625
if let _ = reader.readInt32() {
616626
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatTheme.self)
617627
}
618-
var _4: Int32?
619-
if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() }
628+
var _4: [Api.Chat]?
629+
if let _ = reader.readInt32() {
630+
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
631+
}
632+
var _5: [Api.User]?
633+
if let _ = reader.readInt32() {
634+
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
635+
}
636+
var _6: Int32?
637+
if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() }
620638
let _c1 = _1 != nil
621639
let _c2 = _2 != nil
622640
let _c3 = _3 != nil
623-
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
624-
if _c1 && _c2 && _c3 && _c4 {
625-
return Api.account.ChatThemes.chatThemes(flags: _1!, hash: _2!, themes: _3!, nextOffset: _4)
641+
let _c4 = _4 != nil
642+
let _c5 = _5 != nil
643+
let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil
644+
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
645+
return Api.account.ChatThemes.chatThemes(flags: _1!, hash: _2!, themes: _3!, chats: _4!, users: _5!, nextOffset: _6)
626646
}
627647
else {
628648
return nil

‎submodules/TelegramCore/Sources/State/ManagedRecentStickers.swift‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ func managedUniqueStarGifts(accountPeerId: PeerId, postbox: Postbox, network: Ne
359359
resellForTonOnly: false,
360360
releasedBy: nil,
361361
valueAmount: nil,
362-
valueCurrency: nil
362+
valueCurrency: nil,
363+
flags: [],
364+
themePeerId: nil
363365
)
364366
if let entry = CodableEntry(RecentStarGiftItem(gift)) {
365367
items.append(OrderedItemListEntry(id: RecentStarGiftItemId(id).rawValue, contents: entry))

0 commit comments

Comments
 (0)