diff --git a/packages/core.gbapp/services/GBConversationalService.ts b/packages/core.gbapp/services/GBConversationalService.ts index 65ccc36c..28a16828 100644 --- a/packages/core.gbapp/services/GBConversationalService.ts +++ b/packages/core.gbapp/services/GBConversationalService.ts @@ -254,8 +254,9 @@ export class GBConversationalService { } public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise { - if (step.context.activity.channelId === 'webchat') { - GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) : value} to client...`); + if (!this.userMobile(step)) { + GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) : + value?value:''} to client...`); const msg = MessageFactory.text(''); msg.value = value; msg.type = 'event'; diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 4b7691d0..35598116 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -500,11 +500,27 @@ export class GBDeployer implements IGBDeployer { const nextFolder = urlJoin(remotePath, item.name); await this.downloadFolder(min, localPath, nextFolder); } else { - GBLog.info(`Downloading ${itemPath}...`); - const url = item['@microsoft.graph.downloadUrl']; - - const response = await request({ uri: url, encoding: null }); - Fs.writeFileSync(itemPath, response, { encoding: null }); + let download = false; + + if (Fs.existsSync(itemPath)) { + const dt = Fs.statSync(itemPath); + if (new Date(dt.mtime) < new Date(item.lastModifiedDateTime)) { + download = true; + } + } + + if (download) { + GBLog.info(`Downloading ${itemPath}...`); + const url = item['@microsoft.graph.downloadUrl']; + + const response = await request({ uri: url, encoding: null }); + Fs.writeFileSync(itemPath, response, { encoding: null }); + Fs.utimesSync(itemPath, + new Date(), new Date(item.lastModifiedDateTime)); + } + else{ + GBLog.info(`Local is up to date: ${itemPath}...`); + } } }); } @@ -811,7 +827,7 @@ export class GBDeployer implements IGBDeployer { /** * Servers bot storage assets to be used by web, WhatsApp and other channels. */ - public static mountGBKBAssets(packageName: any, botId: string, filename: string) { + public static mountGBKBAssets(packageName: any, botId: string, filename: string) { // Servers menu assets. @@ -833,7 +849,7 @@ export class GBDeployer implements IGBDeployer { express.static(urlJoin('work', gbaiName, filename, 'videos'))); GBServer.globals.server.use(`/${botId}/cache`, express.static(urlJoin('work', gbaiName, 'cache'))); - GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`, + GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`, express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public'))); diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 4e475b91..86f8029e 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -180,7 +180,7 @@ export class WhatsappDirectLine extends GBService { return; // Exit here. } - if (message.chatName.charAt(0) !== '+') { +if (message.chatName.charAt(0) !== '+') { group = message.chatName; let botGroupName = this.min.core.getParam(this.min.instance, 'WhatsApp Group Name', null); @@ -205,6 +205,7 @@ export class WhatsappDirectLine extends GBService { botShortcuts.forEach(e2 => { if (e1 === e2 && !found) { found = true; + text = text.replace (e2, ''); } });