fix(whatsapp.gblib): Now using e-mail instead of Teams ID.
This commit is contained in:
parent
4ce0ef1a66
commit
58600001c9
2 changed files with 13 additions and 6 deletions
|
@ -104,7 +104,8 @@ export class FeedbackDialog extends IGBDialog {
|
||||||
|
|
||||||
await min.userProfile.set(step.context, profile);
|
await min.userProfile.set(step.context, profile);
|
||||||
|
|
||||||
if (agentSystemId.charAt(2) === ':' || agentSystemId.indexOf('@') > -1) {
|
if (agentSystemId.indexOf('@') !== -1) {
|
||||||
|
|
||||||
// Agent is from Teams or Google Chat.
|
// Agent is from Teams or Google Chat.
|
||||||
|
|
||||||
const agent = await sec.getUserFromSystemId(agentSystemId);
|
const agent = await sec.getUserFromSystemId(agentSystemId);
|
||||||
|
@ -181,7 +182,7 @@ export class FeedbackDialog extends IGBDialog {
|
||||||
step.context.activity.conversation.id
|
step.context.activity.conversation.id
|
||||||
);
|
);
|
||||||
|
|
||||||
if (user.agentSystemId.charAt(2) === ':' || userSystemId.indexOf('@') > -1) {
|
if (user.agentSystemId.indexOf('@') !== -1) {
|
||||||
// Agent is from Teams or Google Chat.
|
// Agent is from Teams or Google Chat.
|
||||||
await min.conversationalService.sendText(
|
await min.conversationalService.sendText(
|
||||||
min,
|
min,
|
||||||
|
|
|
@ -516,7 +516,8 @@ export class WhatsappDirectLine extends GBService {
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
if (user.agentSystemId.charAt(2) === ':') {
|
if (user.agentSystemId.indexOf('@') !== -1) {
|
||||||
|
|
||||||
// Agent is from Teams.
|
// Agent is from Teams.
|
||||||
await this.min.conversationalService['sendOnConversation'](
|
await this.min.conversationalService['sendOnConversation'](
|
||||||
this.min,
|
this.min,
|
||||||
|
@ -535,7 +536,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
await sec.updateHumanAgent(user.agentSystemId, this.min.instance.instanceId, null);
|
await sec.updateHumanAgent(user.agentSystemId, this.min.instance.instanceId, null);
|
||||||
} else {
|
} else {
|
||||||
GBLog.info(`HUMAN AGENT (${manualUser.agentSystemId}) TO USER ${manualUser.userSystemId}: ${text}`);
|
GBLog.info(`HUMAN AGENT (${manualUser.agentSystemId}) TO USER ${manualUser.userSystemId}: ${text}`);
|
||||||
await this.sendToDeviceEx(manualUser.userSystemId, `AGENTE: *${text}*`, locale, null);
|
await this.sendToDeviceEx(manualUser.userSystemId, `AGENT: *${text}*`, locale, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (user.agentMode === 'human') {
|
} else if (user.agentMode === 'human') {
|
||||||
|
@ -552,7 +553,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
} else {
|
} else {
|
||||||
GBLog.info(`USER (${from}) TO AGENT ${agent.userSystemId}: ${text}`);
|
GBLog.info(`USER (${from}) TO AGENT ${agent.userSystemId}: ${text}`);
|
||||||
|
|
||||||
if (user.agentSystemId.charAt(2) === ':' || agent.userSystemId.indexOf('@') > -1) {
|
if (user.agentSystemId.indexOf('@') !== -1) {
|
||||||
// Agent is from Teams or Google Chat.
|
// Agent is from Teams or Google Chat.
|
||||||
await this.min.conversationalService['sendOnConversation'](this.min, agent, text);
|
await this.min.conversationalService['sendOnConversation'](this.min, agent, text);
|
||||||
} else {
|
} else {
|
||||||
|
@ -593,16 +594,21 @@ export class WhatsappDirectLine extends GBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async endTransfer(id: string, locale: string, user: GuaribasUser, agent: GuaribasUser, sec: SecService) {
|
private async endTransfer(id: string, locale: string, user: GuaribasUser, agent: GuaribasUser, sec: SecService) {
|
||||||
|
|
||||||
await this.sendToDeviceEx(id, Messages[this.locale].notify_end_transfer(this.min.instance.botId), locale, null);
|
await this.sendToDeviceEx(id, Messages[this.locale].notify_end_transfer(this.min.instance.botId), locale, null);
|
||||||
|
|
||||||
if (user.agentSystemId.charAt(2) === ':') {
|
if (user.agentSystemId.indexOf('@') !== -1) {
|
||||||
|
|
||||||
// Agent is from Teams.
|
// Agent is from Teams.
|
||||||
|
|
||||||
await this.min.conversationalService['sendOnConversation'](
|
await this.min.conversationalService['sendOnConversation'](
|
||||||
this.min,
|
this.min,
|
||||||
agent,
|
agent,
|
||||||
Messages[this.locale].notify_end_transfer(this.min.instance.botId)
|
Messages[this.locale].notify_end_transfer(this.min.instance.botId)
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
await this.sendToDeviceEx(
|
await this.sendToDeviceEx(
|
||||||
user.agentSystemId,
|
user.agentSystemId,
|
||||||
Messages[this.locale].notify_end_transfer(this.min.instance.botId),
|
Messages[this.locale].notify_end_transfer(this.min.instance.botId),
|
||||||
|
|
Loading…
Add table
Reference in a new issue