Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Telegram schema to the latest layer #1334

Merged
merged 4 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 124 additions & 14 deletions _schema/tdesktop.tl

Large diffs are not rendered by default.

138 changes: 124 additions & 14 deletions _schema/tdlib.tl

Large diffs are not rendered by default.

138 changes: 124 additions & 14 deletions _schema/telegram.tl

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions gen/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ func splitByWords(s string) []string {

// pascal converts the given name into a PascalCase.
//
// user_info => UserInfo
// full_name => FullName
// user_id => UserID
// full-admin => FullAdmin
// cdnConfig => CDNConfig
// cdn_1_config => CDN1Config
// user_info => UserInfo
// full_name => FullName
// user_id => UserID
// full-admin => FullAdmin
// cdnConfig => CDNConfig
// cdn_1_config => CDN1Config
func pascal(s string) string {
words := splitByWords(s)
return pascalWords(words)
Expand Down Expand Up @@ -133,7 +133,8 @@ func ruleset() *inflect.Ruleset {
}

aliases = map[string]string{
"TCPO": "TCPObfuscated",
"TCPO": "TCPObfuscated",
"SMSJOBS": "SMSJobs",
}

return r
Expand Down
14 changes: 14 additions & 0 deletions telegram/query/cached/compute_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ func (s *ContactsGetContacts) computeHash(v *tg.ContactsContacts) int64 {

return h.Sum()
}

func (s *MessagesGetQuickReplies) computeHash(v *tg.MessagesQuickReplies) int64 {
r := v.QuickReplies

sort.SliceStable(r, func(i, j int) bool {
return r[i].ShortcutID < r[j].ShortcutID
})
h := hasher.Hasher{}
for _, contact := range r {
h.Update(uint32(contact.ShortcutID))
}

return h.Sum()
}
84 changes: 84 additions & 0 deletions telegram/query/cached/queries.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

226 changes: 226 additions & 0 deletions tg/tl_account_connected_bots_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading