diff --git a/_schema/tdesktop.tl b/_schema/tdesktop.tl index 853f1eb305..4a80cf5d5f 100644 --- a/_schema/tdesktop.tl +++ b/_schema/tdesktop.tl @@ -1,8 +1,8 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/api.tl -// Layer: 198 -// SHA256: 96d5d03b4fdd27bbc0f1d80e88d10306e590d8fec2d5bbdb0cf268be5e9e1aa6 +// Layer: 199 +// SHA256: 0fe747dde89fdae0ca56903a634fe21dddaeab71929f9f5de2c796cc13d9c497 boolFalse#bc799737 = Bool; @@ -752,7 +752,7 @@ updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; -updatePaidReactionPrivacy#51ca7aec private:Bool = Update; +updatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -1026,7 +1026,7 @@ webPageEmpty#211a1788 flags:# id:long url:flags.0?string = WebPage; webPagePending#b0d13e47 flags:# id:long url:flags.0?string date:int = WebPage; -webPage#e89c45b2 flags:# has_large_media:flags.13?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage; +webPage#e89c45b2 flags:# has_large_media:flags.13?true video_cover_photo:flags.14?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage; webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage; @@ -2740,7 +2740,7 @@ starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_u starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; -starGiftUnique#f2fe7e4a flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int = StarGift; +starGiftUnique#5c62d151 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; @@ -2806,6 +2806,12 @@ inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGif payments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl; +paidReactionPrivacyDefault#206ad49e = PaidReactionPrivacy; + +paidReactionPrivacyAnonymous#1f0c1ad9 = PaidReactionPrivacy; + +paidReactionPrivacyPeer#dc6cfcf0 peer:InputPeer = PaidReactionPrivacy; + ---functions--- @@ -2829,6 +2835,8 @@ invokeWithGooglePlayIntegrity#1df92984 {X:Type} nonce:string token:string query: invokeWithApnsSecret#dae54f8 {X:Type} nonce:string secret:string query:!X = X; +invokeWithReCaptcha#adbb0f94 {X:Type} token:string query:!X = X; + auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode; auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization; @@ -3589,9 +3597,9 @@ messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector = Vector = WebPage; +webPage#e89c45b2 flags:# has_large_media:flags.13?true video_cover_photo:flags.14?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage; webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage; @@ -2741,7 +2741,7 @@ starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_u starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; -starGiftUnique#f2fe7e4a flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int = StarGift; +starGiftUnique#5c62d151 flags:# id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; @@ -2807,6 +2807,12 @@ inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGif payments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl; +paidReactionPrivacyDefault#206ad49e = PaidReactionPrivacy; + +paidReactionPrivacyAnonymous#1f0c1ad9 = PaidReactionPrivacy; + +paidReactionPrivacyPeer#dc6cfcf0 peer:InputPeer = PaidReactionPrivacy; + ---functions--- @@ -2830,6 +2836,8 @@ invokeWithGooglePlayIntegrity#1df92984 {X:Type} nonce:string token:string query: invokeWithApnsSecret#dae54f8 {X:Type} nonce:string secret:string query:!X = X; +invokeWithReCaptcha#adbb0f94 {X:Type} token:string query:!X = X; + auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode; auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization; @@ -3590,9 +3598,9 @@ messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector = Vector 0 { @@ -980,7 +1003,7 @@ func (s *StarGiftUnique) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeStarGiftAttribute(b) if err != nil { - return fmt.Errorf("unable to decode starGiftUnique#f2fe7e4a: field attributes: %w", err) + return fmt.Errorf("unable to decode starGiftUnique#5c62d151: field attributes: %w", err) } s.Attributes = append(s.Attributes, value) } @@ -988,17 +1011,24 @@ func (s *StarGiftUnique) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode starGiftUnique#f2fe7e4a: field availability_issued: %w", err) + return fmt.Errorf("unable to decode starGiftUnique#5c62d151: field availability_issued: %w", err) } s.AvailabilityIssued = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode starGiftUnique#f2fe7e4a: field availability_total: %w", err) + return fmt.Errorf("unable to decode starGiftUnique#5c62d151: field availability_total: %w", err) } s.AvailabilityTotal = value } + if s.Flags.Has(3) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starGiftUnique#5c62d151: field gift_address: %w", err) + } + s.GiftAddress = value + } return nil } @@ -1112,6 +1142,24 @@ func (s *StarGiftUnique) GetAvailabilityTotal() (value int) { return s.AvailabilityTotal } +// SetGiftAddress sets value of GiftAddress conditional field. +func (s *StarGiftUnique) SetGiftAddress(value string) { + s.Flags.Set(3) + s.GiftAddress = value +} + +// GetGiftAddress returns value of GiftAddress conditional field and +// boolean which is true if field was set. +func (s *StarGiftUnique) GetGiftAddress() (value string, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(3) { + return value, false + } + return s.GiftAddress, true +} + // MapAttributes returns field Attributes wrapped in StarGiftAttributeClassArray helper. func (s *StarGiftUnique) MapAttributes() (value StarGiftAttributeClassArray) { return StarGiftAttributeClassArray(s.Attributes) @@ -1136,7 +1184,7 @@ const StarGiftClassName = "StarGift" // } // switch v := g.(type) { // case *tg.StarGift: // starGift#2cc73c8 -// case *tg.StarGiftUnique: // starGiftUnique#f2fe7e4a +// case *tg.StarGiftUnique: // starGiftUnique#5c62d151 // default: panic(v) // } type StarGiftClass interface { @@ -1176,7 +1224,7 @@ func DecodeStarGift(buf *bin.Buffer) (StarGiftClass, error) { } return &v, nil case StarGiftUniqueTypeID: - // Decoding starGiftUnique#f2fe7e4a. + // Decoding starGiftUnique#5c62d151. v := StarGiftUnique{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StarGiftClass: %w", err) diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index fcc52e976d..434f03f3af 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -28471,7 +28471,7 @@ func (u *UpdateBotPurchasedPaidMedia) GetQts() (value int) { return u.Qts } -// UpdatePaidReactionPrivacy represents TL type `updatePaidReactionPrivacy#51ca7aec`. +// UpdatePaidReactionPrivacy represents TL type `updatePaidReactionPrivacy#8b725fce`. // Contains the current default paid reaction privacy, see here »¹ for more info. // Clients should invoke messages.getPaidReactionPrivacy¹ on startup to fetch the // current default reaction privacy because this update is only sent to currently online @@ -28484,11 +28484,11 @@ func (u *UpdateBotPurchasedPaidMedia) GetQts() (value int) { // See https://core.telegram.org/constructor/updatePaidReactionPrivacy for reference. type UpdatePaidReactionPrivacy struct { // Whether paid reaction privacy is enabled or disabled. - Private bool + Private PaidReactionPrivacyClass } // UpdatePaidReactionPrivacyTypeID is TL type id of UpdatePaidReactionPrivacy. -const UpdatePaidReactionPrivacyTypeID = 0x51ca7aec +const UpdatePaidReactionPrivacyTypeID = 0x8b725fce // construct implements constructor of UpdateClass. func (u UpdatePaidReactionPrivacy) construct() UpdateClass { return &u } @@ -28507,7 +28507,7 @@ func (u *UpdatePaidReactionPrivacy) Zero() bool { if u == nil { return true } - if !(u.Private == false) { + if !(u.Private == nil) { return false } @@ -28525,7 +28525,7 @@ func (u *UpdatePaidReactionPrivacy) String() string { // FillFrom fills UpdatePaidReactionPrivacy from given interface. func (u *UpdatePaidReactionPrivacy) FillFrom(from interface { - GetPrivate() (value bool) + GetPrivate() (value PaidReactionPrivacyClass) }) { u.Private = from.GetPrivate() } @@ -28564,7 +28564,7 @@ func (u *UpdatePaidReactionPrivacy) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdatePaidReactionPrivacy) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updatePaidReactionPrivacy#51ca7aec as nil") + return fmt.Errorf("can't encode updatePaidReactionPrivacy#8b725fce as nil") } b.PutID(UpdatePaidReactionPrivacyTypeID) return u.EncodeBare(b) @@ -28573,19 +28573,24 @@ func (u *UpdatePaidReactionPrivacy) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdatePaidReactionPrivacy) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updatePaidReactionPrivacy#51ca7aec as nil") + return fmt.Errorf("can't encode updatePaidReactionPrivacy#8b725fce as nil") + } + if u.Private == nil { + return fmt.Errorf("unable to encode updatePaidReactionPrivacy#8b725fce: field private is nil") + } + if err := u.Private.Encode(b); err != nil { + return fmt.Errorf("unable to encode updatePaidReactionPrivacy#8b725fce: field private: %w", err) } - b.PutBool(u.Private) return nil } // Decode implements bin.Decoder. func (u *UpdatePaidReactionPrivacy) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updatePaidReactionPrivacy#51ca7aec to nil") + return fmt.Errorf("can't decode updatePaidReactionPrivacy#8b725fce to nil") } if err := b.ConsumeID(UpdatePaidReactionPrivacyTypeID); err != nil { - return fmt.Errorf("unable to decode updatePaidReactionPrivacy#51ca7aec: %w", err) + return fmt.Errorf("unable to decode updatePaidReactionPrivacy#8b725fce: %w", err) } return u.DecodeBare(b) } @@ -28593,12 +28598,12 @@ func (u *UpdatePaidReactionPrivacy) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdatePaidReactionPrivacy) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updatePaidReactionPrivacy#51ca7aec to nil") + return fmt.Errorf("can't decode updatePaidReactionPrivacy#8b725fce to nil") } { - value, err := b.Bool() + value, err := DecodePaidReactionPrivacy(b) if err != nil { - return fmt.Errorf("unable to decode updatePaidReactionPrivacy#51ca7aec: field private: %w", err) + return fmt.Errorf("unable to decode updatePaidReactionPrivacy#8b725fce: field private: %w", err) } u.Private = value } @@ -28606,7 +28611,7 @@ func (u *UpdatePaidReactionPrivacy) DecodeBare(b *bin.Buffer) error { } // GetPrivate returns value of Private field. -func (u *UpdatePaidReactionPrivacy) GetPrivate() (value bool) { +func (u *UpdatePaidReactionPrivacy) GetPrivate() (value PaidReactionPrivacyClass) { if u == nil { return } @@ -28910,7 +28915,7 @@ const UpdateClassName = "Update" // case *tg.UpdateBusinessBotCallbackQuery: // updateBusinessBotCallbackQuery#1ea2fda7 // case *tg.UpdateStarsRevenueStatus: // updateStarsRevenueStatus#a584b019 // case *tg.UpdateBotPurchasedPaidMedia: // updateBotPurchasedPaidMedia#283bd312 -// case *tg.UpdatePaidReactionPrivacy: // updatePaidReactionPrivacy#51ca7aec +// case *tg.UpdatePaidReactionPrivacy: // updatePaidReactionPrivacy#8b725fce // default: panic(v) // } type UpdateClass interface { @@ -29920,7 +29925,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdatePaidReactionPrivacyTypeID: - // Decoding updatePaidReactionPrivacy#51ca7aec. + // Decoding updatePaidReactionPrivacy#8b725fce. v := UpdatePaidReactionPrivacy{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) diff --git a/tg/tl_web_page_gen.go b/tg/tl_web_page_gen.go index 80e8a770c1..4a5774425f 100644 --- a/tg/tl_web_page_gen.go +++ b/tg/tl_web_page_gen.go @@ -478,6 +478,8 @@ type WebPage struct { Flags bin.Fields // Whether the size of the media in the preview can be changed. HasLargeMedia bool + // VideoCoverPhoto field of WebPage. + VideoCoverPhoto bool // Preview ID ID int64 // URL of previewed webpage @@ -581,6 +583,9 @@ func (w *WebPage) Zero() bool { if !(w.HasLargeMedia == false) { return false } + if !(w.VideoCoverPhoto == false) { + return false + } if !(w.ID == 0) { return false } @@ -651,6 +656,7 @@ func (w *WebPage) String() string { // FillFrom fills WebPage from given interface. func (w *WebPage) FillFrom(from interface { GetHasLargeMedia() (value bool) + GetVideoCoverPhoto() (value bool) GetID() (value int64) GetURL() (value string) GetDisplayURL() (value string) @@ -671,6 +677,7 @@ func (w *WebPage) FillFrom(from interface { GetAttributes() (value []WebPageAttributeClass, ok bool) }) { w.HasLargeMedia = from.GetHasLargeMedia() + w.VideoCoverPhoto = from.GetVideoCoverPhoto() w.ID = from.GetID() w.URL = from.GetURL() w.DisplayURL = from.GetDisplayURL() @@ -761,6 +768,11 @@ func (w *WebPage) TypeInfo() tdp.Type { SchemaName: "has_large_media", Null: !w.Flags.Has(13), }, + { + Name: "VideoCoverPhoto", + SchemaName: "video_cover_photo", + Null: !w.Flags.Has(14), + }, { Name: "ID", SchemaName: "id", @@ -856,6 +868,9 @@ func (w *WebPage) SetFlags() { if !(w.HasLargeMedia == false) { w.Flags.Set(13) } + if !(w.VideoCoverPhoto == false) { + w.Flags.Set(14) + } if !(w.Type == "") { w.Flags.Set(0) } @@ -1009,6 +1024,7 @@ func (w *WebPage) DecodeBare(b *bin.Buffer) error { } } w.HasLargeMedia = w.Flags.Has(13) + w.VideoCoverPhoto = w.Flags.Has(14) { value, err := b.Long() if err != nil { @@ -1165,6 +1181,25 @@ func (w *WebPage) GetHasLargeMedia() (value bool) { return w.Flags.Has(13) } +// SetVideoCoverPhoto sets value of VideoCoverPhoto conditional field. +func (w *WebPage) SetVideoCoverPhoto(value bool) { + if value { + w.Flags.Set(14) + w.VideoCoverPhoto = true + } else { + w.Flags.Unset(14) + w.VideoCoverPhoto = false + } +} + +// GetVideoCoverPhoto returns value of VideoCoverPhoto conditional field. +func (w *WebPage) GetVideoCoverPhoto() (value bool) { + if w == nil { + return + } + return w.Flags.Has(14) +} + // GetID returns value of ID field. func (w *WebPage) GetID() (value int64) { if w == nil {