mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-21 20:20:17 +01:00
Update to TDLib 1.8.50
This commit is contained in:
parent
969ddb4746
commit
bc2b5f5823
4 changed files with 1133 additions and 109 deletions
|
|
@ -1599,6 +1599,43 @@ func UnmarshalListOfPaidReactionType(dataList []json.RawMessage) ([]PaidReaction
|
|||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopic(data json.RawMessage) (MessageTopic, error) {
|
||||
var meta meta
|
||||
|
||||
err := json.Unmarshal(data, &meta)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch meta.Type {
|
||||
case TypeMessageTopicForum:
|
||||
return UnmarshalMessageTopicForum(data)
|
||||
|
||||
case TypeMessageTopicDirectMessages:
|
||||
return UnmarshalMessageTopicDirectMessages(data)
|
||||
|
||||
case TypeMessageTopicSavedMessages:
|
||||
return UnmarshalMessageTopicSavedMessages(data)
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
|
||||
}
|
||||
}
|
||||
|
||||
func UnmarshalListOfMessageTopic(dataList []json.RawMessage) ([]MessageTopic, error) {
|
||||
list := []MessageTopic{}
|
||||
|
||||
for _, data := range dataList {
|
||||
entity, err := UnmarshalMessageTopic(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list = append(list, entity)
|
||||
}
|
||||
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func UnmarshalMessageEffectType(data json.RawMessage) (MessageEffectType, error) {
|
||||
var meta meta
|
||||
|
||||
|
|
@ -1756,6 +1793,9 @@ func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) {
|
|||
case TypeMessageSourceForumTopicHistory:
|
||||
return UnmarshalMessageSourceForumTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceDirectMessagesChatTopicHistory:
|
||||
return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceHistoryPreview:
|
||||
return UnmarshalMessageSourceHistoryPreview(data)
|
||||
|
||||
|
|
@ -3608,6 +3648,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
|
|||
case TypeMessagePaidMessagePriceChanged:
|
||||
return UnmarshalMessagePaidMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageDirectMessagePriceChanged:
|
||||
return UnmarshalMessageDirectMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageContactRegistered:
|
||||
return UnmarshalMessageContactRegistered(data)
|
||||
|
||||
|
|
@ -8393,6 +8436,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateDirectMessagesChatTopic:
|
||||
return UnmarshalUpdateDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeUpdateTopicMessageCount:
|
||||
return UnmarshalUpdateTopicMessageCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
|
|
@ -11484,6 +11533,30 @@ func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) {
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicForum(data json.RawMessage) (*MessageTopicForum, error) {
|
||||
var resp MessageTopicForum
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicDirectMessages(data json.RawMessage) (*MessageTopicDirectMessages, error) {
|
||||
var resp MessageTopicDirectMessages
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageTopicSavedMessages(data json.RawMessage) (*MessageTopicSavedMessages, error) {
|
||||
var resp MessageTopicSavedMessages
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageEffectTypeEmojiReaction(data json.RawMessage) (*MessageEffectTypeEmojiReaction, error) {
|
||||
var resp MessageEffectTypeEmojiReaction
|
||||
|
||||
|
|
@ -11692,6 +11765,14 @@ func UnmarshalMessageSourceForumTopicHistory(data json.RawMessage) (*MessageSour
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageSourceDirectMessagesChatTopicHistory(data json.RawMessage) (*MessageSourceDirectMessagesChatTopicHistory, error) {
|
||||
var resp MessageSourceDirectMessagesChatTopicHistory
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageSourceHistoryPreview(data json.RawMessage) (*MessageSourceHistoryPreview, error) {
|
||||
var resp MessageSourceHistoryPreview
|
||||
|
||||
|
|
@ -12572,6 +12653,14 @@ func UnmarshalSavedMessagesTopic(data json.RawMessage) (*SavedMessagesTopic, err
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalDirectMessagesChatTopic(data json.RawMessage) (*DirectMessagesChatTopic, error) {
|
||||
var resp DirectMessagesChatTopic
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) {
|
||||
var resp ForumTopicIcon
|
||||
|
||||
|
|
@ -14836,6 +14925,14 @@ func UnmarshalMessagePaidMessagePriceChanged(data json.RawMessage) (*MessagePaid
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageDirectMessagePriceChanged(data json.RawMessage) (*MessageDirectMessagePriceChanged, error) {
|
||||
var resp MessageDirectMessagePriceChanged
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) {
|
||||
var resp MessageContactRegistered
|
||||
|
||||
|
|
@ -21948,6 +22045,22 @@ func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedM
|
|||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateDirectMessagesChatTopic(data json.RawMessage) (*UpdateDirectMessagesChatTopic, error) {
|
||||
var resp UpdateDirectMessagesChatTopic
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateTopicMessageCount(data json.RawMessage) (*UpdateTopicMessageCount, error) {
|
||||
var resp UpdateTopicMessageCount
|
||||
|
||||
err := json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, err
|
||||
}
|
||||
|
||||
func UnmarshalUpdateQuickReplyShortcut(data json.RawMessage) (*UpdateQuickReplyShortcut, error) {
|
||||
var resp UpdateQuickReplyShortcut
|
||||
|
||||
|
|
@ -23929,6 +24042,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUnreadReaction:
|
||||
return UnmarshalUnreadReaction(data)
|
||||
|
||||
case TypeMessageTopicForum:
|
||||
return UnmarshalMessageTopicForum(data)
|
||||
|
||||
case TypeMessageTopicDirectMessages:
|
||||
return UnmarshalMessageTopicDirectMessages(data)
|
||||
|
||||
case TypeMessageTopicSavedMessages:
|
||||
return UnmarshalMessageTopicSavedMessages(data)
|
||||
|
||||
case TypeMessageEffectTypeEmojiReaction:
|
||||
return UnmarshalMessageEffectTypeEmojiReaction(data)
|
||||
|
||||
|
|
@ -24007,6 +24129,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeMessageSourceForumTopicHistory:
|
||||
return UnmarshalMessageSourceForumTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceDirectMessagesChatTopicHistory:
|
||||
return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data)
|
||||
|
||||
case TypeMessageSourceHistoryPreview:
|
||||
return UnmarshalMessageSourceHistoryPreview(data)
|
||||
|
||||
|
|
@ -24337,6 +24462,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeSavedMessagesTopic:
|
||||
return UnmarshalSavedMessagesTopic(data)
|
||||
|
||||
case TypeDirectMessagesChatTopic:
|
||||
return UnmarshalDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeForumTopicIcon:
|
||||
return UnmarshalForumTopicIcon(data)
|
||||
|
||||
|
|
@ -25186,6 +25314,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeMessagePaidMessagePriceChanged:
|
||||
return UnmarshalMessagePaidMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageDirectMessagePriceChanged:
|
||||
return UnmarshalMessageDirectMessagePriceChanged(data)
|
||||
|
||||
case TypeMessageContactRegistered:
|
||||
return UnmarshalMessageContactRegistered(data)
|
||||
|
||||
|
|
@ -27853,6 +27984,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
|
|||
case TypeUpdateSavedMessagesTopicCount:
|
||||
return UnmarshalUpdateSavedMessagesTopicCount(data)
|
||||
|
||||
case TypeUpdateDirectMessagesChatTopic:
|
||||
return UnmarshalUpdateDirectMessagesChatTopic(data)
|
||||
|
||||
case TypeUpdateTopicMessageCount:
|
||||
return UnmarshalUpdateTopicMessageCount(data)
|
||||
|
||||
case TypeUpdateQuickReplyShortcut:
|
||||
return UnmarshalUpdateQuickReplyShortcut(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue