fix: WhatsApp channel_conv_id als nummer@c.us normalisieren beim Senden

This commit is contained in:
2026-03-17 14:57:24 +01:00
parent 2324ffd714
commit b880cabcde

View File

@@ -51,7 +51,11 @@ async def send(db: Session, req: SendMessageRequest) -> Message:
else: else:
recipient_id = req.recipient_phone recipient_id = req.recipient_phone
contact = contact_service.get_or_create_by_phone(db, recipient_id) contact = contact_service.get_or_create_by_phone(db, recipient_id)
channel_conv_id = recipient_id # WhatsApp: channel_conv_id immer als "nummer@c.us" normalisieren
if req.channel == "whatsapp":
channel_conv_id = recipient_id.replace("@c.us", "").lstrip("+") + "@c.us"
else:
channel_conv_id = recipient_id
conv = conversation_service.get_or_create( conv = conversation_service.get_or_create(
db, req.channel, channel_conv_id, contact db, req.channel, channel_conv_id, contact