fix(all): Templates OK.

This commit is contained in:
me@rodrigorodriguez.com 2024-09-29 20:33:39 -03:00
parent 110083e1c1
commit 2a245f9530
2 changed files with 9 additions and 5 deletions

View file

@ -1085,7 +1085,10 @@ export class GBMinService {
} }
} }
let pid = step.context.activity['pid']; let pid = step.context.activity['pid'] ?
step.context.activity['pid'] :
step.context.activity.from['pid'];
let recipient = context.activity?.recipient?.id; let recipient = context.activity?.recipient?.id;
if (!pid && recipient !== min.botId) { if (!pid && recipient !== min.botId) {
@ -1143,7 +1146,7 @@ export class GBMinService {
GBLogEx.info( GBLogEx.info(
min, min,
`Input> ${context.activity.text} (type: ${context.activity.type}, name: ${context.activity.name}, channelId: ${context.activity.channelId})` `Human: pid:${pid} ${context.activity.text} (type: ${context.activity.type}, name: ${context.activity.name}, channelId: ${context.activity.channelId})`
); );
// Answer to specific BOT Framework event conversationUpdate to auto start dialogs. // Answer to specific BOT Framework event conversationUpdate to auto start dialogs.

View file

@ -556,9 +556,9 @@ export class WhatsappDirectLine extends GBService {
WhatsappDirectLine.chatIds[generatedConversationId] = message?.chatId; WhatsappDirectLine.chatIds[generatedConversationId] = message?.chatId;
this.pollMessages(client, generatedConversationId, from, fromName); this.pollMessages(client, generatedConversationId, from, fromName);
this.inputMessage(client, generatedConversationId, text, from, fromName, group, attachments); this.inputMessage(client, generatedConversationId, text, from, fromName, group, attachments, pid);
} else { } else {
this.inputMessage(client, conversationId, text, from, fromName, group, attachments); this.inputMessage(client, conversationId, text, from, fromName, group, attachments, null);
} }
} else { } else {
GBLog.warn(`Inconsistencty found: Invalid agentMode on User Table: ${user.agentMode}`); GBLog.warn(`Inconsistencty found: Invalid agentMode on User Table: ${user.agentMode}`);
@ -592,7 +592,7 @@ export class WhatsappDirectLine extends GBService {
await sec.updateHumanAgent(id, this.min.instance.instanceId, null); await sec.updateHumanAgent(id, this.min.instance.instanceId, null);
} }
public inputMessage(client, conversationId: string, text: string, from, fromName: string, group, attachments: File) { public inputMessage(client, conversationId: string, text: string, from, fromName: string, group, attachments: File, pid = null) {
try { try {
return client.apis.Conversations.Conversations_PostActivity({ return client.apis.Conversations.Conversations_PostActivity({
conversationId: conversationId, conversationId: conversationId,
@ -610,6 +610,7 @@ export class WhatsappDirectLine extends GBService {
id: from, id: from,
name: fromName, name: fromName,
channelIdEx: 'whatsapp', channelIdEx: 'whatsapp',
pid: pid,
group: group group: group
}, },
replyToId: from replyToId: from