move gotd fork into repo. (#111)
- update to latest telegram layer - remove some references to fields in tg.Entities that don't exist in the schema - originally added here: https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e - referenced here - https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3 - https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package cached
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"go.mau.fi/mautrix-telegram/pkg/gotd/telegram/query/hasher"
|
||||
"go.mau.fi/mautrix-telegram/pkg/gotd/tg"
|
||||
)
|
||||
|
||||
func (s *ContactsGetContacts) computeHash(v *tg.ContactsContacts) int64 {
|
||||
cts := v.Contacts
|
||||
|
||||
sort.SliceStable(cts, func(i, j int) bool {
|
||||
return cts[i].UserID < cts[j].UserID
|
||||
})
|
||||
h := hasher.Hasher{}
|
||||
for _, contact := range cts {
|
||||
h.Update(uint32(contact.UserID))
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// Package cached contains cached query helpers.
|
||||
package cached
|
||||
@@ -0,0 +1,3 @@
|
||||
package cached
|
||||
|
||||
//go:generate go run go.mau.fi/mautrix-telegram/pkg/gotd/telegram/query/internal/cachedgen -package=cached -out=queries.gen.go
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user