Update to TDLib 1.8.8

This commit is contained in:
c0re100 2022-11-08 02:50:52 +08:00
parent 65692be746
commit abdd0dfd48
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1952 additions and 160 deletions

View file

@ -1610,6 +1610,46 @@ func UnmarshalListOfInputInvoice(dataList []json.RawMessage) ([]InputInvoice, er
return list, nil
}
func UnmarshalMessageExtendedMedia(data json.RawMessage) (MessageExtendedMedia, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeMessageExtendedMediaPreview:
return UnmarshalMessageExtendedMediaPreview(data)
case TypeMessageExtendedMediaPhoto:
return UnmarshalMessageExtendedMediaPhoto(data)
case TypeMessageExtendedMediaVideo:
return UnmarshalMessageExtendedMediaVideo(data)
case TypeMessageExtendedMediaUnsupported:
return UnmarshalMessageExtendedMediaUnsupported(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfMessageExtendedMedia(dataList []json.RawMessage) ([]MessageExtendedMedia, error) {
list := []MessageExtendedMedia{}
for _, data := range dataList {
entity, err := UnmarshalMessageExtendedMedia(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalPassportElementType(data json.RawMessage) (PassportElementType, error) {
var meta meta
@ -2047,6 +2087,15 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageChatSetTtl:
return UnmarshalMessageChatSetTtl(data)
case TypeMessageForumTopicCreated:
return UnmarshalMessageForumTopicCreated(data)
case TypeMessageForumTopicEdited:
return UnmarshalMessageForumTopicEdited(data)
case TypeMessageForumTopicIsClosedToggled:
return UnmarshalMessageForumTopicIsClosedToggled(data)
case TypeMessageCustomServiceAction:
return UnmarshalMessageCustomServiceAction(data)
@ -3033,6 +3082,9 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventUsernameChanged:
return UnmarshalChatEventUsernameChanged(data)
case TypeChatEventActiveUsernamesChanged:
return UnmarshalChatEventActiveUsernamesChanged(data)
case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data)
@ -3069,6 +3121,24 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventVideoChatParticipantVolumeLevelChanged:
return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data)
case TypeChatEventIsForumToggled:
return UnmarshalChatEventIsForumToggled(data)
case TypeChatEventForumTopicCreated:
return UnmarshalChatEventForumTopicCreated(data)
case TypeChatEventForumTopicEdited:
return UnmarshalChatEventForumTopicEdited(data)
case TypeChatEventForumTopicToggleIsClosed:
return UnmarshalChatEventForumTopicToggleIsClosed(data)
case TypeChatEventForumTopicDeleted:
return UnmarshalChatEventForumTopicDeleted(data)
case TypeChatEventForumTopicPinned:
return UnmarshalChatEventForumTopicPinned(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -3228,6 +3298,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) {
case TypePremiumFeatureAnimatedProfilePhoto:
return UnmarshalPremiumFeatureAnimatedProfilePhoto(data)
case TypePremiumFeatureForumTopicIcon:
return UnmarshalPremiumFeatureForumTopicIcon(data)
case TypePremiumFeatureAppIcons:
return UnmarshalPremiumFeatureAppIcons(data)
@ -5064,6 +5137,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data)
@ -5584,14 +5660,6 @@ func UnmarshalFile(data json.RawMessage) (*File, error) {
return &resp, err
}
func UnmarshalFiles(data json.RawMessage) (*Files, error) {
var resp Files
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputFileId(data json.RawMessage) (*InputFileId, error) {
var resp InputFileId
@ -6104,6 +6172,14 @@ func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) {
return &resp, err
}
func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) {
var resp Usernames
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUser(data json.RawMessage) (*User, error) {
var resp User
@ -6504,6 +6580,22 @@ func UnmarshalMessageSenders(data json.RawMessage) (*MessageSenders, error) {
return &resp, err
}
func UnmarshalChatMessageSender(data json.RawMessage) (*ChatMessageSender, error) {
var resp ChatMessageSender
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, error) {
var resp ChatMessageSenders
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) {
var resp MessageForwardOriginUser
@ -6680,6 +6772,14 @@ func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error)
return &resp, err
}
func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error) {
var resp SponsoredMessages
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) {
var resp FileDownload
@ -7192,6 +7292,30 @@ func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error
return &resp, err
}
func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) {
var resp ForumTopicIcon
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalForumTopicInfo(data json.RawMessage) (*ForumTopicInfo, error) {
var resp ForumTopicInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalForumTopic(data json.RawMessage) (*ForumTopic, error) {
var resp ForumTopic
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) {
var resp RichTextPlain
@ -7864,6 +7988,38 @@ func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error)
return &resp, err
}
func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) {
var resp MessageExtendedMediaPreview
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaPhoto(data json.RawMessage) (*MessageExtendedMediaPhoto, error) {
var resp MessageExtendedMediaPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaVideo(data json.RawMessage) (*MessageExtendedMediaVideo, error) {
var resp MessageExtendedMediaVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExtendedMediaUnsupported, error) {
var resp MessageExtendedMediaUnsupported
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) {
var resp DatedFile
@ -8760,6 +8916,30 @@ func UnmarshalMessageChatSetTtl(data json.RawMessage) (*MessageChatSetTtl, error
return &resp, err
}
func UnmarshalMessageForumTopicCreated(data json.RawMessage) (*MessageForumTopicCreated, error) {
var resp MessageForumTopicCreated
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForumTopicEdited(data json.RawMessage) (*MessageForumTopicEdited, error) {
var resp MessageForumTopicEdited
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageForumTopicIsClosedToggled(data json.RawMessage) (*MessageForumTopicIsClosedToggled, error) {
var resp MessageForumTopicIsClosedToggled
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) {
var resp MessageCustomServiceAction
@ -10432,6 +10612,14 @@ func UnmarshalChatEventUsernameChanged(data json.RawMessage) (*ChatEventUsername
return &resp, err
}
func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventActiveUsernamesChanged, error) {
var resp ChatEventActiveUsernamesChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) {
var resp ChatEventHasProtectedContentToggled
@ -10528,6 +10716,54 @@ func UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data json.RawMessa
return &resp, err
}
func UnmarshalChatEventIsForumToggled(data json.RawMessage) (*ChatEventIsForumToggled, error) {
var resp ChatEventIsForumToggled
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicCreated(data json.RawMessage) (*ChatEventForumTopicCreated, error) {
var resp ChatEventForumTopicCreated
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicEdited(data json.RawMessage) (*ChatEventForumTopicEdited, error) {
var resp ChatEventForumTopicEdited
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicToggleIsClosed(data json.RawMessage) (*ChatEventForumTopicToggleIsClosed, error) {
var resp ChatEventForumTopicToggleIsClosed
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicDeleted(data json.RawMessage) (*ChatEventForumTopicDeleted, error) {
var resp ChatEventForumTopicDeleted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventForumTopicPinned(data json.RawMessage) (*ChatEventForumTopicPinned, error) {
var resp ChatEventForumTopicPinned
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEvent(data json.RawMessage) (*ChatEvent, error) {
var resp ChatEvent
@ -10784,6 +11020,14 @@ func UnmarshalPremiumFeatureAnimatedProfilePhoto(data json.RawMessage) (*Premium
return &resp, err
}
func UnmarshalPremiumFeatureForumTopicIcon(data json.RawMessage) (*PremiumFeatureForumTopicIcon, error) {
var resp PremiumFeatureForumTopicIcon
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumFeatureAppIcons(data json.RawMessage) (*PremiumFeatureAppIcons, error) {
var resp PremiumFeatureAppIcons
@ -13392,6 +13636,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli
return &resp, err
}
func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) {
var resp UpdateForumTopicInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateScopeNotificationSettings(data json.RawMessage) (*UpdateScopeNotificationSettings, error) {
var resp UpdateScopeNotificationSettings
@ -14127,9 +14379,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeFile:
return UnmarshalFile(data)
case TypeFiles:
return UnmarshalFiles(data)
case TypeInputFileId:
return UnmarshalInputFileId(data)
@ -14322,6 +14571,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmojiStatuses:
return UnmarshalEmojiStatuses(data)
case TypeUsernames:
return UnmarshalUsernames(data)
case TypeUser:
return UnmarshalUser(data)
@ -14472,6 +14724,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageSenders:
return UnmarshalMessageSenders(data)
case TypeChatMessageSender:
return UnmarshalChatMessageSender(data)
case TypeChatMessageSenders:
return UnmarshalChatMessageSenders(data)
case TypeMessageForwardOriginUser:
return UnmarshalMessageForwardOriginUser(data)
@ -14538,6 +14796,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSponsoredMessage:
return UnmarshalSponsoredMessage(data)
case TypeSponsoredMessages:
return UnmarshalSponsoredMessages(data)
case TypeFileDownload:
return UnmarshalFileDownload(data)
@ -14730,6 +14991,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageThreadInfo:
return UnmarshalMessageThreadInfo(data)
case TypeForumTopicIcon:
return UnmarshalForumTopicIcon(data)
case TypeForumTopicInfo:
return UnmarshalForumTopicInfo(data)
case TypeForumTopic:
return UnmarshalForumTopic(data)
case TypeRichTextPlain:
return UnmarshalRichTextPlain(data)
@ -14982,6 +15252,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInputInvoiceName:
return UnmarshalInputInvoiceName(data)
case TypeMessageExtendedMediaPreview:
return UnmarshalMessageExtendedMediaPreview(data)
case TypeMessageExtendedMediaPhoto:
return UnmarshalMessageExtendedMediaPhoto(data)
case TypeMessageExtendedMediaVideo:
return UnmarshalMessageExtendedMediaVideo(data)
case TypeMessageExtendedMediaUnsupported:
return UnmarshalMessageExtendedMediaUnsupported(data)
case TypeDatedFile:
return UnmarshalDatedFile(data)
@ -15318,6 +15600,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageChatSetTtl:
return UnmarshalMessageChatSetTtl(data)
case TypeMessageForumTopicCreated:
return UnmarshalMessageForumTopicCreated(data)
case TypeMessageForumTopicEdited:
return UnmarshalMessageForumTopicEdited(data)
case TypeMessageForumTopicIsClosedToggled:
return UnmarshalMessageForumTopicIsClosedToggled(data)
case TypeMessageCustomServiceAction:
return UnmarshalMessageCustomServiceAction(data)
@ -15945,6 +16236,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventUsernameChanged:
return UnmarshalChatEventUsernameChanged(data)
case TypeChatEventActiveUsernamesChanged:
return UnmarshalChatEventActiveUsernamesChanged(data)
case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data)
@ -15981,6 +16275,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventVideoChatParticipantVolumeLevelChanged:
return UnmarshalChatEventVideoChatParticipantVolumeLevelChanged(data)
case TypeChatEventIsForumToggled:
return UnmarshalChatEventIsForumToggled(data)
case TypeChatEventForumTopicCreated:
return UnmarshalChatEventForumTopicCreated(data)
case TypeChatEventForumTopicEdited:
return UnmarshalChatEventForumTopicEdited(data)
case TypeChatEventForumTopicToggleIsClosed:
return UnmarshalChatEventForumTopicToggleIsClosed(data)
case TypeChatEventForumTopicDeleted:
return UnmarshalChatEventForumTopicDeleted(data)
case TypeChatEventForumTopicPinned:
return UnmarshalChatEventForumTopicPinned(data)
case TypeChatEvent:
return UnmarshalChatEvent(data)
@ -16077,6 +16389,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumFeatureAnimatedProfilePhoto:
return UnmarshalPremiumFeatureAnimatedProfilePhoto(data)
case TypePremiumFeatureForumTopicIcon:
return UnmarshalPremiumFeatureForumTopicIcon(data)
case TypePremiumFeatureAppIcons:
return UnmarshalPremiumFeatureAppIcons(data)
@ -17055,6 +17370,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
case TypeUpdateScopeNotificationSettings:
return UnmarshalUpdateScopeNotificationSettings(data)