Skip to content

Commit 845aa1e

Browse files
committed
Published 3.10 to npm
1 parent 9b094dc commit 845aa1e

File tree

4 files changed

+17
-570
lines changed

4 files changed

+17
-570
lines changed

Node/core/lib/bots/UniversalBot.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,14 @@ var UniversalBot = (function (_super) {
250250
this._onDisambiguateRoute = handler;
251251
};
252252
UniversalBot.prototype.loadSession = function (address, done) {
253+
this.loadSessionWithOptionalDispatch(address, false, done);
254+
};
255+
UniversalBot.prototype.loadSessionWithoutDispatching = function (address, done) {
256+
this.loadSessionWithOptionalDispatch(address, false, done);
257+
};
258+
UniversalBot.prototype.loadSessionWithOptionalDispatch = function (address, shouldDispatch, done) {
253259
var _this = this;
260+
var newStack = false;
254261
this.lookupUser(address, function (user) {
255262
var msg = {
256263
type: consts.messageType,
@@ -271,7 +278,7 @@ var UniversalBot = (function (_super) {
271278
persistUserData: _this.settings.persistUserData,
272279
persistConversationData: _this.settings.persistConversationData
273280
};
274-
_this.createSession(storageCtx, msg, _this.settings.defaultDialogId || '/', _this.settings.defaultDialogArgs, done);
281+
_this.createSession(storageCtx, msg, _this.settings.defaultDialogId || '/', _this.settings.defaultDialogArgs, done, newStack, shouldDispatch);
275282
}, _this.errorLogger(done));
276283
}, this.errorLogger(done));
277284
};
@@ -288,9 +295,10 @@ var UniversalBot = (function (_super) {
288295
}
289296
}, newStack);
290297
};
291-
UniversalBot.prototype.createSession = function (storageCtx, message, dialogId, dialogArgs, done, newStack) {
298+
UniversalBot.prototype.createSession = function (storageCtx, message, dialogId, dialogArgs, done, newStack, shouldDispatch) {
292299
var _this = this;
293300
if (newStack === void 0) { newStack = false; }
301+
if (shouldDispatch === void 0) { shouldDispatch = true; }
294302
var loadedData;
295303
this.getStorageData(storageCtx, function (data) {
296304
if (!_this.localizer) {
@@ -340,7 +348,12 @@ var UniversalBot = (function (_super) {
340348
delete session.privateConversationData[consts.Data.SessionState];
341349
}
342350
loadedData = data;
343-
session.dispatch(sessionState, message, function () { return done(null, session); });
351+
if (shouldDispatch) {
352+
session.dispatch(sessionState, message, function () { return done(null, session); });
353+
}
354+
else {
355+
done(null, session);
356+
}
344357
}, done);
345358
};
346359
UniversalBot.prototype.routeMessage = function (session, done) {

Node/core/lib/dialogs/Fields.js

Lines changed: 0 additions & 309 deletions
This file was deleted.

0 commit comments

Comments
 (0)