Skip to content

Commit 78594ec

Browse files
committed
fix: add computeHash for PaymentsGetStarGiftCollections
1 parent ae08ba7 commit 78594ec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

telegram/query/cached/compute_hash.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ func (s *MessagesGetQuickReplies) computeHash(v *tg.MessagesQuickReplies) int64
3434

3535
return h.Sum()
3636
}
37+
38+
func (s *PaymentsGetStarGiftCollections) computeHash(v *tg.PaymentsStarGiftCollections) int64 {
39+
collections := v.Collections
40+
41+
sort.SliceStable(collections, func(i, j int) bool {
42+
return collections[i].CollectionID < collections[j].CollectionID
43+
})
44+
45+
h := hasher.Hasher{}
46+
for _, collection := range collections {
47+
h.Update(uint32(collection.CollectionID))
48+
}
49+
50+
return h.Sum()
51+
}

0 commit comments

Comments
 (0)