fix: sync sticker material reuse handling

This commit is contained in:
A 2026-07-02 02:43:48 +08:00
parent bb07eb16d1
commit 20b388eeaa
5 changed files with 370 additions and 44 deletions

View file

@ -19,8 +19,9 @@ func (s *Service) AddStickerToSet(ctx context.Context, actorUserID int64, ref do
if err != nil {
return domain.StickerSet{}, nil, err
}
if ownedSetID, _, ok := doc.StickerSetRef(); ok && ownedSetID != set.ID {
return domain.StickerSet{}, nil, domain.ErrStickerSetFileInvalid
doc, err = s.materialDocumentForStickerSet(ctx, doc, set.ID)
if err != nil {
return domain.StickerSet{}, nil, err
}
if containsInt64(set.DocumentIDs, doc.ID) {
return set, docs, nil