chore: refresh gramsrv public release

This commit is contained in:
A 2026-06-30 14:37:43 +08:00
parent 75cebe8dbf
commit 70b6820474
1274 changed files with 378751 additions and 59919 deletions

View file

@ -0,0 +1,30 @@
package rpc
import (
"context"
"fmt"
"telesrv/internal/domain"
)
func (r *Router) pinnedDialogsList(ctx context.Context, userID int64, folderID int) (domain.DialogList, error) {
if r == nil || r.deps.Dialogs == nil {
return domain.DialogList{}, nil
}
key := fmt.Sprintf("%d:%d", userID, folderID)
value, err, _ := r.dialogsPinnedSF.Do(key, func() (any, error) {
return r.deps.Dialogs.GetDialogs(ctx, userID, domain.DialogFilter{
PinnedOnly: true,
HasFolderID: true,
FolderID: folderID,
Limit: 100,
})
})
if err != nil {
return domain.DialogList{}, err
}
if list, ok := value.(domain.DialogList); ok {
return list, nil
}
return domain.DialogList{}, nil
}