fix(all): Fix user switching on a single chip.
This commit is contained in:
parent
ed964247da
commit
d261ea371b
1 changed files with 8 additions and 1 deletions
|
@ -313,10 +313,17 @@ export class WhatsappDirectLine extends GBService {
|
||||||
message = req;
|
message = req;
|
||||||
to = message.to.endsWith('@g.us') ? message.to.split('@')[0] : message.to.split('@')[0];
|
to = message.to.endsWith('@g.us') ? message.to.split('@')[0] : message.to.split('@')[0];
|
||||||
const newThis = WhatsappDirectLine.botsByNumber[to];
|
const newThis = WhatsappDirectLine.botsByNumber[to];
|
||||||
|
|
||||||
|
// Every number must be mapped to a bot, even if shared by boot bot.
|
||||||
|
|
||||||
if (newThis === undefined) {
|
if (newThis === undefined) {
|
||||||
throw GBError.create(`Bot Number ${to} not setup for any loaded bot.`);
|
throw GBError.create(`Bot Number ${to} not setup for any loaded bot.`);
|
||||||
} else {
|
} else {
|
||||||
if (newThis.min.botId !== this.min.botId) {
|
|
||||||
|
// Reroute to custom bot only if it is not boot bot.
|
||||||
|
|
||||||
|
if (newThis.min.botId !== this.min.botId &&
|
||||||
|
GBServer.globals.minBoot.botId !== this.min.botId) {
|
||||||
await newThis.received(req, res);
|
await newThis.received(req, res);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue