(ctx context.Context, id int64)
| 3074 | } |
| 3075 | |
| 3076 | func (q *querier) GetChatMessageByID(ctx context.Context, id int64) (database.ChatMessage, error) { |
| 3077 | // ChatMessages are authorized through their parent Chat. |
| 3078 | // We need to fetch the message first to get its chat_id. |
| 3079 | msg, err := q.db.GetChatMessageByID(ctx, id) |
| 3080 | if err != nil { |
| 3081 | return database.ChatMessage{}, err |
| 3082 | } |
| 3083 | // Authorize read on the parent chat. |
| 3084 | _, err = q.GetChatByID(ctx, msg.ChatID) |
| 3085 | if err != nil { |
| 3086 | return database.ChatMessage{}, err |
| 3087 | } |
| 3088 | return msg, nil |
| 3089 | } |
| 3090 | |
| 3091 | func (q *querier) GetChatMessageSummariesPerChat(ctx context.Context, createdAfter time.Time) ([]database.GetChatMessageSummariesPerChatRow, error) { |
| 3092 | // Telemetry queries are called from system contexts only. |
nothing calls this directly
no test coverage detected