Add channel-scoped conversations for iMessage, WhatsApp, and email

Revert get_conversation_for_user to use Conversation.get() with
MultipleObjectsReturned fallback. Add channel field to Conversation
model and get_conversation_for_channel helper so each messaging
channel gets its own isolated conversation per user.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 19:39:39 -04:00
parent a693874662
commit 3ba93c55f4
5 changed files with 45 additions and 21 deletions
+1
View File
@@ -21,6 +21,7 @@ class Conversation(Model):
user: fields.ForeignKeyRelation = fields.ForeignKeyField(
"models.User", related_name="conversations", null=True
)
channel = fields.CharField(max_length=20, default="web", null=True)
class Meta:
table = "conversations"