(chat database.Chat)
| 2772 | } |
| 2773 | |
| 2774 | func isActiveAgentChat(chat database.Chat) bool { |
| 2775 | if chat.Archived { |
| 2776 | return false |
| 2777 | } |
| 2778 | |
| 2779 | switch chat.Status { |
| 2780 | case database.ChatStatusWaiting, |
| 2781 | database.ChatStatusPending, |
| 2782 | database.ChatStatusRunning, |
| 2783 | database.ChatStatusPaused, |
| 2784 | database.ChatStatusRequiresAction: |
| 2785 | return true |
| 2786 | default: |
| 2787 | return false |
| 2788 | } |
| 2789 | } |
| 2790 | |
| 2791 | func clearAgentChatContext( |
| 2792 | ctx context.Context, |
no outgoing calls