Allow linking chats

This commit is contained in:
2026-02-19 17:13:34 +00:00
parent bac2841298
commit 0816687c71
15 changed files with 369 additions and 461 deletions

View File

@@ -34,6 +34,7 @@ from core.models import (
PatternMitigationRule,
Person,
PersonIdentifier,
PlatformChatLink,
QueuedMessage,
WorkspaceConversation,
WorkspaceMetricSnapshot,
@@ -3538,6 +3539,24 @@ class AIWorkspaceContactsWidget(LoginRequiredMixin, View):
}
)
rows.sort(key=lambda row: row["last_ts"] or 0, reverse=True)
for link in PlatformChatLink.objects.filter(user=user, is_group=True).order_by(
"service", "chat_name"
):
rows.append(
{
"person": None,
"is_group": True,
"chat_name": link.chat_name or link.chat_identifier,
"service": link.service,
"chat_identifier": link.chat_identifier,
"message_count": 0,
"last_text": "",
"last_ts": None,
"last_ts_label": "",
}
)
return rows
def get(self, request, type):