merged from gramsrv upstream

This commit is contained in:
onysd 2026-09-01 12:06:31 +03:00
parent 79c64ee916
commit 21a0856587
651 changed files with 54774 additions and 4590 deletions

View file

@ -56,6 +56,10 @@ func TestAccountSettingsRoundTrip(t *testing.T) {
NewNoncontactPeersRequirePremium: true,
}
in.SetNoncontactPeersPaidStars(50)
in.SetDisallowedGifts(tg.DisallowedGiftsSettings{
DisallowLimitedStargifts: true,
DisallowPremiumGifts: true,
})
saved, err := r.onAccountSetGlobalPrivacySettings(ctx, in)
if err != nil {
t.Fatalf("set global privacy: %v", err)
@ -135,4 +139,10 @@ func assertGlobalPrivacy(t *testing.T, got *tg.GlobalPrivacySettings, want tg.Gl
if gotStars != wantStars {
t.Fatalf("noncontact paid stars = %d, want %d", gotStars, wantStars)
}
wantGifts, wantGiftsOK := want.GetDisallowedGifts()
gotGifts, gotGiftsOK := got.GetDisallowedGifts()
if gotGiftsOK != wantGiftsOK || gotGifts != wantGifts {
t.Fatalf("disallowed gifts = %+v ok=%v, want %+v ok=%v",
gotGifts, gotGiftsOK, wantGifts, wantGiftsOK)
}
}