(ctx context.Context, defaultAutoArchiveDays int32)
| 2810 | } |
| 2811 | |
| 2812 | func (q *querier) GetChatAutoArchiveDays(ctx context.Context, defaultAutoArchiveDays int32) (int32, error) { |
| 2813 | // Chat auto-archive is a deployment-wide config read by dbpurge. |
| 2814 | // Only requires a valid actor in context. The HTTP GET handler |
| 2815 | // allows any authenticated user; the PUT handler enforces admin |
| 2816 | // access (policy.ActionUpdate on ResourceDeploymentConfig). |
| 2817 | if _, ok := ActorFromContext(ctx); !ok { |
| 2818 | return 0, ErrNoActor |
| 2819 | } |
| 2820 | return q.db.GetChatAutoArchiveDays(ctx, defaultAutoArchiveDays) |
| 2821 | } |
| 2822 | |
| 2823 | func (q *querier) GetChatByID(ctx context.Context, id uuid.UUID) (database.Chat, error) { |
| 2824 | return fetch(q.log, q.auth, q.db.GetChatByID)(ctx, id) |
nothing calls this directly
no test coverage detected