Skip to content

Commit 31d1b0a

Browse files
committed
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
2 parents 2caa983 + b04eee8 commit 31d1b0a

File tree

30 files changed

+686
-124
lines changed

30 files changed

+686
-124
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15432,3 +15432,5 @@ Error: %8$@";
1543215432

1543315433
"LiveStream.ErrorMaxAllowedEmoji.Text_1" = "You can send up to %d emoji.";
1543415434
"LiveStream.ErrorMaxAllowedEmoji.Text_any" = "You can send up to %d emoji.";
15435+
15436+
"Stars.Purchase.StarGiftOfferInfo" = "Buy Stars to make a gift buy offer.";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ public enum StarsWithdrawalScreenSubject {
11781178
case enterAmount(current: StarsAmount, minValue: StarsAmount, fractionAfterCommission: Int, kind: PaidMessageKind, completion: (Int64) -> Void)
11791179
case postSuggestion(channel: EnginePeer, isFromAdmin: Bool, current: CurrencyAmount, timestamp: Int32?, completion: (CurrencyAmount, Int32?) -> Void)
11801180
case postSuggestionModification(current: CurrencyAmount, timestamp: Int32?, completion: (CurrencyAmount, Int32?) -> Void)
1181+
case starGiftOffer(peer: EnginePeer, gift: StarGift.UniqueGift, completion: (CurrencyAmount, Int32) -> Void)
11811182
}
11821183

11831184
public enum ChannelMembersSearchControllerMode {

submodules/AccountContext/Sources/Premium.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public enum StarsPurchasePurpose: Equatable {
144144
case sendMessage(peerId: EnginePeer.Id, requiredStars: Int64)
145145
case buyStarGift(requiredStars: Int64)
146146
case removeOriginalDetailsStarGift(requiredStars: Int64)
147+
case starGiftOffer(requiredStars: Int64)
147148
}
148149

149150
public struct PremiumConfiguration {

submodules/TelegramApi/Sources/Api0.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
621621
dict[1348510708] = { return Api.MessageAction.parse_messageActionSetChatWallPaper($0) }
622622
dict[1007897979] = { return Api.MessageAction.parse_messageActionSetMessagesTTL($0) }
623623
dict[-614898352] = { return Api.MessageAction.parse_messageActionStarGift($0) }
624+
dict[2000845012] = { return Api.MessageAction.parse_messageActionStarGiftPurchaseOffer($0) }
625+
dict[1940760427] = { return Api.MessageAction.parse_messageActionStarGiftPurchaseOfferDeclined($0) }
624626
dict[-1787656893] = { return Api.MessageAction.parse_messageActionStarGiftUnique($0) }
625627
dict[747579941] = { return Api.MessageAction.parse_messageActionSuggestBirthday($0) }
626628
dict[1474192222] = { return Api.MessageAction.parse_messageActionSuggestProfilePhoto($0) }
@@ -979,7 +981,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
979981
dict[1124938064] = { return Api.SponsoredMessageReportOption.parse_sponsoredMessageReportOption($0) }
980982
dict[-963180333] = { return Api.SponsoredPeer.parse_sponsoredPeer($0) }
981983
dict[463097215] = { return Api.StarGift.parse_starGift($0) }
982-
dict[-1329630181] = { return Api.StarGift.parse_starGiftUnique($0) }
984+
dict[-1624264554] = { return Api.StarGift.parse_starGiftUnique($0) }
983985
dict[-753154979] = { return Api.StarGiftActiveAuctionState.parse_starGiftActiveAuctionState($0) }
984986
dict[-650279524] = { return Api.StarGiftAttribute.parse_starGiftAttributeBackdrop($0) }
985987
dict[970559507] = { return Api.StarGiftAttribute.parse_starGiftAttributeModel($0) }

submodules/TelegramApi/Sources/Api15.swift

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,8 @@ public extension Api {
10701070
case messageActionSetChatWallPaper(flags: Int32, wallpaper: Api.WallPaper)
10711071
case messageActionSetMessagesTTL(flags: Int32, period: Int32, autoSettingFrom: Int64?)
10721072
case messageActionStarGift(flags: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, convertStars: Int64?, upgradeMsgId: Int32?, upgradeStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, prepaidUpgradeHash: String?, giftMsgId: Int32?, toId: Api.Peer?)
1073+
case messageActionStarGiftPurchaseOffer(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount, expiresAt: Int32)
1074+
case messageActionStarGiftPurchaseOfferDeclined(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount)
10731075
case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleAmount: Api.StarsAmount?, canTransferAt: Int32?, canResellAt: Int32?, dropOriginalDetailsStars: Int64?)
10741076
case messageActionSuggestBirthday(birthday: Api.Birthday)
10751077
case messageActionSuggestProfilePhoto(photo: Api.Photo)
@@ -1477,6 +1479,23 @@ public extension Api {
14771479
if Int(flags) & Int(1 << 15) != 0 {serializeInt32(giftMsgId!, buffer: buffer, boxed: false)}
14781480
if Int(flags) & Int(1 << 18) != 0 {toId!.serialize(buffer, true)}
14791481
break
1482+
case .messageActionStarGiftPurchaseOffer(let flags, let gift, let price, let expiresAt):
1483+
if boxed {
1484+
buffer.appendInt32(2000845012)
1485+
}
1486+
serializeInt32(flags, buffer: buffer, boxed: false)
1487+
gift.serialize(buffer, true)
1488+
price.serialize(buffer, true)
1489+
serializeInt32(expiresAt, buffer: buffer, boxed: false)
1490+
break
1491+
case .messageActionStarGiftPurchaseOfferDeclined(let flags, let gift, let price):
1492+
if boxed {
1493+
buffer.appendInt32(1940760427)
1494+
}
1495+
serializeInt32(flags, buffer: buffer, boxed: false)
1496+
gift.serialize(buffer, true)
1497+
price.serialize(buffer, true)
1498+
break
14801499
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleAmount, let canTransferAt, let canResellAt, let dropOriginalDetailsStars):
14811500
if boxed {
14821501
buffer.appendInt32(-1787656893)
@@ -1680,6 +1699,10 @@ public extension Api {
16801699
return ("messageActionSetMessagesTTL", [("flags", flags as Any), ("period", period as Any), ("autoSettingFrom", autoSettingFrom as Any)])
16811700
case .messageActionStarGift(let flags, let gift, let message, let convertStars, let upgradeMsgId, let upgradeStars, let fromId, let peer, let savedId, let prepaidUpgradeHash, let giftMsgId, let toId):
16821701
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), ("prepaidUpgradeHash", prepaidUpgradeHash as Any), ("giftMsgId", giftMsgId as Any), ("toId", toId as Any)])
1702+
case .messageActionStarGiftPurchaseOffer(let flags, let gift, let price, let expiresAt):
1703+
return ("messageActionStarGiftPurchaseOffer", [("flags", flags as Any), ("gift", gift as Any), ("price", price as Any), ("expiresAt", expiresAt as Any)])
1704+
case .messageActionStarGiftPurchaseOfferDeclined(let flags, let gift, let price):
1705+
return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", flags as Any), ("gift", gift as Any), ("price", price as Any)])
16831706
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleAmount, let canTransferAt, let canResellAt, let dropOriginalDetailsStars):
16841707
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), ("resaleAmount", resaleAmount as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any), ("dropOriginalDetailsStars", dropOriginalDetailsStars as Any)])
16851708
case .messageActionSuggestBirthday(let birthday):
@@ -2473,6 +2496,51 @@ public extension Api {
24732496
return nil
24742497
}
24752498
}
2499+
public static func parse_messageActionStarGiftPurchaseOffer(_ reader: BufferReader) -> MessageAction? {
2500+
var _1: Int32?
2501+
_1 = reader.readInt32()
2502+
var _2: Api.StarGift?
2503+
if let signature = reader.readInt32() {
2504+
_2 = Api.parse(reader, signature: signature) as? Api.StarGift
2505+
}
2506+
var _3: Api.StarsAmount?
2507+
if let signature = reader.readInt32() {
2508+
_3 = Api.parse(reader, signature: signature) as? Api.StarsAmount
2509+
}
2510+
var _4: Int32?
2511+
_4 = reader.readInt32()
2512+
let _c1 = _1 != nil
2513+
let _c2 = _2 != nil
2514+
let _c3 = _3 != nil
2515+
let _c4 = _4 != nil
2516+
if _c1 && _c2 && _c3 && _c4 {
2517+
return Api.MessageAction.messageActionStarGiftPurchaseOffer(flags: _1!, gift: _2!, price: _3!, expiresAt: _4!)
2518+
}
2519+
else {
2520+
return nil
2521+
}
2522+
}
2523+
public static func parse_messageActionStarGiftPurchaseOfferDeclined(_ reader: BufferReader) -> MessageAction? {
2524+
var _1: Int32?
2525+
_1 = reader.readInt32()
2526+
var _2: Api.StarGift?
2527+
if let signature = reader.readInt32() {
2528+
_2 = Api.parse(reader, signature: signature) as? Api.StarGift
2529+
}
2530+
var _3: Api.StarsAmount?
2531+
if let signature = reader.readInt32() {
2532+
_3 = Api.parse(reader, signature: signature) as? Api.StarsAmount
2533+
}
2534+
let _c1 = _1 != nil
2535+
let _c2 = _2 != nil
2536+
let _c3 = _3 != nil
2537+
if _c1 && _c2 && _c3 {
2538+
return Api.MessageAction.messageActionStarGiftPurchaseOfferDeclined(flags: _1!, gift: _2!, price: _3!)
2539+
}
2540+
else {
2541+
return nil
2542+
}
2543+
}
24762544
public static func parse_messageActionStarGiftUnique(_ reader: BufferReader) -> MessageAction? {
24772545
var _1: Int32?
24782546
_1 = reader.readInt32()

submodules/TelegramApi/Sources/Api25.swift

Lines changed: 11 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?, auctionSlug: String?, giftsPerRound: 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?, themePeer: Api.Peer?, peerColor: Api.PeerColor?, hostId: Api.Peer?)
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?, peerColor: Api.PeerColor?, hostId: Api.Peer?, offerMinStars: Int32?)
293293

294294
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
295295
switch self {
@@ -317,9 +317,9 @@ public extension Api {
317317
if Int(flags) & Int(1 << 11) != 0 {serializeString(auctionSlug!, buffer: buffer, boxed: false)}
318318
if Int(flags) & Int(1 << 11) != 0 {serializeInt32(giftsPerRound!, buffer: buffer, boxed: false)}
319319
break
320-
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, let peerColor, let hostId):
320+
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, let peerColor, let hostId, let offerMinStars):
321321
if boxed {
322-
buffer.appendInt32(-1329630181)
322+
buffer.appendInt32(-1624264554)
323323
}
324324
serializeInt32(flags, buffer: buffer, boxed: false)
325325
serializeInt64(id, buffer: buffer, boxed: false)
@@ -349,6 +349,7 @@ public extension Api {
349349
if Int(flags) & Int(1 << 10) != 0 {themePeer!.serialize(buffer, true)}
350350
if Int(flags) & Int(1 << 11) != 0 {peerColor!.serialize(buffer, true)}
351351
if Int(flags) & Int(1 << 12) != 0 {hostId!.serialize(buffer, true)}
352+
if Int(flags) & Int(1 << 13) != 0 {serializeInt32(offerMinStars!, buffer: buffer, boxed: false)}
352353
break
353354
}
354355
}
@@ -357,8 +358,8 @@ public extension Api {
357358
switch self {
358359
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, let auctionSlug, let giftsPerRound):
359360
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), ("auctionSlug", auctionSlug as Any), ("giftsPerRound", giftsPerRound as Any)])
360-
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, let peerColor, let hostId):
361-
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), ("peerColor", peerColor as Any), ("hostId", hostId as Any)])
361+
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, let peerColor, let hostId, let offerMinStars):
362+
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), ("peerColor", peerColor as Any), ("hostId", hostId as Any), ("offerMinStars", offerMinStars as Any)])
362363
}
363364
}
364365

@@ -486,6 +487,8 @@ public extension Api {
486487
if Int(_1!) & Int(1 << 12) != 0 {if let signature = reader.readInt32() {
487488
_20 = Api.parse(reader, signature: signature) as? Api.Peer
488489
} }
490+
var _21: Int32?
491+
if Int(_1!) & Int(1 << 13) != 0 {_21 = reader.readInt32() }
489492
let _c1 = _1 != nil
490493
let _c2 = _2 != nil
491494
let _c3 = _3 != nil
@@ -506,8 +509,9 @@ public extension Api {
506509
let _c18 = (Int(_1!) & Int(1 << 10) == 0) || _18 != nil
507510
let _c19 = (Int(_1!) & Int(1 << 11) == 0) || _19 != nil
508511
let _c20 = (Int(_1!) & Int(1 << 12) == 0) || _20 != nil
509-
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 {
510-
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, peerColor: _19, hostId: _20)
512+
let _c21 = (Int(_1!) & Int(1 << 13) == 0) || _21 != nil
513+
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 {
514+
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, peerColor: _19, hostId: _20, offerMinStars: _21)
511515
}
512516
else {
513517
return nil

0 commit comments

Comments
 (0)