Skip to content

Commit 9483448

Browse files
committed
Update API
1 parent 9f6c3a9 commit 9483448

File tree

13 files changed

+111
-40
lines changed

13 files changed

+111
-40
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14220,3 +14220,8 @@ Sorry for the inconvenience.";
1422014220

1422114221
"Channel.AdminLog.MessageToggleAutoTranslateOn" = "%@ enabled autotranslation of messages";
1422214222
"Channel.AdminLog.MessageToggleAutoTranslateOff" = "%@ disabled autotranslation of messages";
14223+
14224+
"Notification.StarsGift.Bought" = "%1$@ gifted you %2$@ for %3$@";
14225+
"Notification.StarsGift.Bought.Stars_1" = "%@ Star";
14226+
"Notification.StarsGift.Bought.Stars_any" = "%@ Stars";
14227+
"Notification.StarsGift.BoughtYou" = "You gifted %1$@ for %2$@";

submodules/TelegramApi/Sources/Api0.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
603603
dict[1348510708] = { return Api.MessageAction.parse_messageActionSetChatWallPaper($0) }
604604
dict[1007897979] = { return Api.MessageAction.parse_messageActionSetMessagesTTL($0) }
605605
dict[1192749220] = { return Api.MessageAction.parse_messageActionStarGift($0) }
606-
dict[1600878025] = { return Api.MessageAction.parse_messageActionStarGiftUnique($0) }
606+
dict[775611918] = { return Api.MessageAction.parse_messageActionStarGiftUnique($0) }
607607
dict[1474192222] = { return Api.MessageAction.parse_messageActionSuggestProfilePhoto($0) }
608608
dict[228168278] = { return Api.MessageAction.parse_messageActionTopicCreate($0) }
609609
dict[-1064024032] = { return Api.MessageAction.parse_messageActionTopicEdit($0) }
@@ -872,7 +872,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
872872
dict[289586518] = { return Api.SavedContact.parse_savedPhoneContact($0) }
873873
dict[-1115174036] = { return Api.SavedDialog.parse_savedDialog($0) }
874874
dict[-881854424] = { return Api.SavedReactionTag.parse_savedReactionTag($0) }
875-
dict[1616305061] = { return Api.SavedStarGift.parse_savedStarGift($0) }
875+
dict[-539360103] = { return Api.SavedStarGift.parse_savedStarGift($0) }
876876
dict[-911191137] = { return Api.SearchResultsCalendarPeriod.parse_searchResultsCalendarPeriod($0) }
877877
dict[2137295719] = { return Api.SearchResultsPosition.parse_searchResultPosition($0) }
878878
dict[871426631] = { return Api.SecureCredentialsEncrypted.parse_secureCredentialsEncrypted($0) }

submodules/TelegramApi/Sources/Api15.swift

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public extension Api {
381381
case messageActionSetChatWallPaper(flags: Int32, wallpaper: Api.WallPaper)
382382
case messageActionSetMessagesTTL(flags: Int32, period: Int32, autoSettingFrom: Int64?)
383383
case messageActionStarGift(flags: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, convertStars: Int64?, upgradeMsgId: Int32?, upgradeStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?)
384-
case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleStars: Int64?)
384+
case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?)
385385
case messageActionSuggestProfilePhoto(photo: Api.Photo)
386386
case messageActionTopicCreate(flags: Int32, title: String, iconColor: Int32, iconEmojiId: Int64?)
387387
case messageActionTopicEdit(flags: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?)
@@ -767,9 +767,9 @@ public extension Api {
767767
if Int(flags) & Int(1 << 12) != 0 {peer!.serialize(buffer, true)}
768768
if Int(flags) & Int(1 << 12) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)}
769769
break
770-
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars):
770+
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars, let canTransferAt, let canResellAt):
771771
if boxed {
772-
buffer.appendInt32(1600878025)
772+
buffer.appendInt32(775611918)
773773
}
774774
serializeInt32(flags, buffer: buffer, boxed: false)
775775
gift.serialize(buffer, true)
@@ -779,6 +779,8 @@ public extension Api {
779779
if Int(flags) & Int(1 << 7) != 0 {peer!.serialize(buffer, true)}
780780
if Int(flags) & Int(1 << 7) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)}
781781
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(resaleStars!, buffer: buffer, boxed: false)}
782+
if Int(flags) & Int(1 << 9) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)}
783+
if Int(flags) & Int(1 << 10) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)}
782784
break
783785
case .messageActionSuggestProfilePhoto(let photo):
784786
if boxed {
@@ -913,8 +915,8 @@ public extension Api {
913915
return ("messageActionSetMessagesTTL", [("flags", flags as Any), ("period", period as Any), ("autoSettingFrom", autoSettingFrom as Any)])
914916
case .messageActionStarGift(let flags, let gift, let message, let convertStars, let upgradeMsgId, let upgradeStars, let fromId, let peer, let savedId):
915917
return ("messageActionStarGift", [("flags", flags as Any), ("gift", gift as Any), ("message", message as Any), ("convertStars", convertStars as Any), ("upgradeMsgId", upgradeMsgId as Any), ("upgradeStars", upgradeStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any)])
916-
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars):
917-
return ("messageActionStarGiftUnique", [("flags", flags as Any), ("gift", gift as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("resaleStars", resaleStars as Any)])
918+
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars, let canTransferAt, let canResellAt):
919+
return ("messageActionStarGiftUnique", [("flags", flags as Any), ("gift", gift as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("resaleStars", resaleStars as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any)])
918920
case .messageActionSuggestProfilePhoto(let photo):
919921
return ("messageActionSuggestProfilePhoto", [("photo", photo as Any)])
920922
case .messageActionTopicCreate(let flags, let title, let iconColor, let iconEmojiId):
@@ -1675,6 +1677,10 @@ public extension Api {
16751677
if Int(_1!) & Int(1 << 7) != 0 {_7 = reader.readInt64() }
16761678
var _8: Int64?
16771679
if Int(_1!) & Int(1 << 8) != 0 {_8 = reader.readInt64() }
1680+
var _9: Int32?
1681+
if Int(_1!) & Int(1 << 9) != 0 {_9 = reader.readInt32() }
1682+
var _10: Int32?
1683+
if Int(_1!) & Int(1 << 10) != 0 {_10 = reader.readInt32() }
16781684
let _c1 = _1 != nil
16791685
let _c2 = _2 != nil
16801686
let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil
@@ -1683,8 +1689,10 @@ public extension Api {
16831689
let _c6 = (Int(_1!) & Int(1 << 7) == 0) || _6 != nil
16841690
let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil
16851691
let _c8 = (Int(_1!) & Int(1 << 8) == 0) || _8 != nil
1686-
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
1687-
return Api.MessageAction.messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleStars: _8)
1692+
let _c9 = (Int(_1!) & Int(1 << 9) == 0) || _9 != nil
1693+
let _c10 = (Int(_1!) & Int(1 << 10) == 0) || _10 != nil
1694+
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
1695+
return Api.MessageAction.messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleStars: _8, canTransferAt: _9, canResellAt: _10)
16881696
}
16891697
else {
16901698
return nil

submodules/TelegramApi/Sources/Api23.swift

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ public extension Api {
144144
}
145145
public extension Api {
146146
enum SavedStarGift: TypeConstructorDescription {
147-
case savedStarGift(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?)
147+
case savedStarGift(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?)
148148

149149
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
150150
switch self {
151-
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars):
151+
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt):
152152
if boxed {
153-
buffer.appendInt32(1616305061)
153+
buffer.appendInt32(-539360103)
154154
}
155155
serializeInt32(flags, buffer: buffer, boxed: false)
156156
if Int(flags) & Int(1 << 1) != 0 {fromId!.serialize(buffer, true)}
@@ -163,14 +163,16 @@ public extension Api {
163163
if Int(flags) & Int(1 << 6) != 0 {serializeInt64(upgradeStars!, buffer: buffer, boxed: false)}
164164
if Int(flags) & Int(1 << 7) != 0 {serializeInt32(canExportAt!, buffer: buffer, boxed: false)}
165165
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(transferStars!, buffer: buffer, boxed: false)}
166+
if Int(flags) & Int(1 << 13) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)}
167+
if Int(flags) & Int(1 << 14) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)}
166168
break
167169
}
168170
}
169171

170172
public func descriptionFields() -> (String, [(String, Any)]) {
171173
switch self {
172-
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars):
173-
return ("savedStarGift", [("flags", flags as Any), ("fromId", fromId as Any), ("date", date as Any), ("gift", gift as Any), ("message", message as Any), ("msgId", msgId as Any), ("savedId", savedId as Any), ("convertStars", convertStars as Any), ("upgradeStars", upgradeStars as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any)])
174+
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt):
175+
return ("savedStarGift", [("flags", flags as Any), ("fromId", fromId as Any), ("date", date as Any), ("gift", gift as Any), ("message", message as Any), ("msgId", msgId as Any), ("savedId", savedId as Any), ("convertStars", convertStars as Any), ("upgradeStars", upgradeStars as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any)])
174176
}
175177
}
176178

@@ -203,6 +205,10 @@ public extension Api {
203205
if Int(_1!) & Int(1 << 7) != 0 {_10 = reader.readInt32() }
204206
var _11: Int64?
205207
if Int(_1!) & Int(1 << 8) != 0 {_11 = reader.readInt64() }
208+
var _12: Int32?
209+
if Int(_1!) & Int(1 << 13) != 0 {_12 = reader.readInt32() }
210+
var _13: Int32?
211+
if Int(_1!) & Int(1 << 14) != 0 {_13 = reader.readInt32() }
206212
let _c1 = _1 != nil
207213
let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil
208214
let _c3 = _3 != nil
@@ -214,8 +220,10 @@ public extension Api {
214220
let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil
215221
let _c10 = (Int(_1!) & Int(1 << 7) == 0) || _10 != nil
216222
let _c11 = (Int(_1!) & Int(1 << 8) == 0) || _11 != nil
217-
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
218-
return Api.SavedStarGift.savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11)
223+
let _c12 = (Int(_1!) & Int(1 << 13) == 0) || _12 != nil
224+
let _c13 = (Int(_1!) & Int(1 << 14) == 0) || _13 != nil
225+
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 {
226+
return Api.SavedStarGift.savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13)
219227
}
220228
else {
221229
return nil

submodules/TelegramCore/Sources/ApiUtils/TelegramMediaAction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ func telegramMediaActionFromApiAction(_ action: Api.MessageAction) -> TelegramMe
192192
return nil
193193
}
194194
return TelegramMediaAction(action: .starGift(gift: gift, convertStars: convertStars, text: text, entities: entities, nameHidden: (flags & (1 << 0)) != 0, savedToProfile: (flags & (1 << 2)) != 0, converted: (flags & (1 << 3)) != 0, upgraded: (flags & (1 << 5)) != 0, canUpgrade: (flags & (1 << 10)) != 0, upgradeStars: upgradeStars, isRefunded: (flags & (1 << 9)) != 0, upgradeMessageId: upgradeMessageId, peerId: peer?.peerId, senderId: fromId?.peerId, savedId: savedId))
195-
case let .messageActionStarGiftUnique(flags, apiGift, canExportAt, transferStars, fromId, peer, savedId, resaleStars):
195+
case let .messageActionStarGiftUnique(flags, apiGift, canExportAt, transferStars, fromId, peer, savedId, resaleStars, canTransferDate, canResaleDate):
196196
guard let gift = StarGift(apiStarGift: apiGift) else {
197197
return nil
198198
}
199-
return TelegramMediaAction(action: .starGiftUnique(gift: gift, isUpgrade: (flags & (1 << 0)) != 0, isTransferred: (flags & (1 << 1)) != 0, savedToProfile: (flags & (1 << 2)) != 0, canExportDate: canExportAt, transferStars: transferStars, isRefunded: (flags & (1 << 5)) != 0, peerId: peer?.peerId, senderId: fromId?.peerId, savedId: savedId, resaleStars: resaleStars))
199+
return TelegramMediaAction(action: .starGiftUnique(gift: gift, isUpgrade: (flags & (1 << 0)) != 0, isTransferred: (flags & (1 << 1)) != 0, savedToProfile: (flags & (1 << 2)) != 0, canExportDate: canExportAt, transferStars: transferStars, isRefunded: (flags & (1 << 5)) != 0, peerId: peer?.peerId, senderId: fromId?.peerId, savedId: savedId, resaleStars: resaleStars, canTransferDate: canTransferDate, canResaleDate: canResaleDate))
200200
case let .messageActionPaidMessagesRefunded(count, stars):
201201
return TelegramMediaAction(action: .paidMessagesRefunded(count: count, stars: stars))
202202
case let .messageActionPaidMessagesPrice(stars):

0 commit comments

Comments
 (0)