From 4f6f483a272b23f629612036ef5984fb01e1437e Mon Sep 17 00:00:00 2001 From: borja Date: Sat, 6 Sep 2025 14:15:48 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20a=C3=B1adir=20menciones=20del=20creador?= =?UTF-8?q?=20y=20de=20asignados=20en=20notificaciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (openrouter/openai/gpt-5) --- src/services/command.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/services/command.ts b/src/services/command.ts index a4dde41..360cb66 100644 --- a/src/services/command.ts +++ b/src/services/command.ts @@ -155,6 +155,7 @@ export class CommandService { // Resolver nombres útiles const creatorName = await ContactsService.getDisplayName(createdBy); + const creatorJid = `${createdBy}@s.whatsapp.net`; const groupName = groupIdToUse ? GroupSyncService.activeGroupsCache.get(groupIdToUse) : null; const assignedDisplayNames = await Promise.all( @@ -175,7 +176,10 @@ export class CommandService { `✅ Tarea ${taskId} creada:\n` + `• ${description || '(sin descripción)'}\n` + (dueDate ? `• Vence: ${dueDate}\n` : '') + - (assignedDisplayNames.length ? `• Asignados: ${assignedDisplayNames.join(', ')}` : '') + (assignmentUserIds.length + ? `• Asignados: ${assignmentUserIds.map((uid, idx) => `${assignedDisplayNames[idx] || uid} (@${uid})`).join(', ')}` + : ''), + mentions: mentionsForSending.length > 0 ? mentionsForSending : undefined }); } @@ -187,8 +191,9 @@ export class CommandService { `🆕 Nueva tarea:\n` + `• ${description || '(sin descripción)'}\n` + (dueDate ? `• Vence: ${dueDate}\n` : '') + - `• Asignada por: ${creatorName || createdBy}` + - (groupName ? `\n• Grupo: ${groupName}` : '') + `• Asignada por: ${creatorName || createdBy} (@${createdBy})` + + (groupName ? `\n• Grupo: ${groupName}` : ''), + mentions: [creatorJid] }); }