protected async onContinueDialog()

in sdk/typescript/libraries/bot-solutions/src/dialogs/activityHandlerDialog.ts [46:103]


    protected async onContinueDialog(innerDc: DialogContext): Promise<DialogTurnResult> {
        // Check for any interruptions.
        const status = await this.onInterruptDialog(innerDc);

        if (status === InterruptionAction.Resume) {
            // Interruption message was sent, and the waiting dialog should resume/reprompt.
            await innerDc.repromptDialog();
        } else if (status === InterruptionAction.Waiting) {
            // Interruption intercepted conversation and is waiting for user to respond.
            return Dialog.EndOfTurn;
        } else if (status === InterruptionAction.End) {
            // Interruption ended conversation, and current dialog should end.
            return await innerDc.endDialog();
        } else if (status === InterruptionAction.NoAction) {
            // No interruption was detected. Process activity normally.
            const activity: Activity = innerDc.context.activity;
            
            switch (activity.type) {
                case ActivityTypes.Message: {
                    // Pass message to waiting child dialog.
                    const result: DialogTurnResult = await innerDc.continueDialog();

                    if (result.status == DialogTurnStatus.empty) {
                        // There was no waiting dialog on the stack, process message normally.    
                        await this.onMessageActivity(innerDc);
                    }

                    break;
                }
                case ActivityTypes.Event: {
                    await this.onEventActivity(innerDc);
                    break;
                }
                case ActivityTypes.Invoke: {
                    // Used by Teams for Authentication scenarios.
                    await innerDc.continueDialog();
                    break;
                }
                case ActivityTypes.ConversationUpdate: {
                  
                    await this.onMembersAdded(innerDc);
                    break;
                }
                default: {
                    // All other activity types will be routed here. Custom handling should be added in implementation.
                    await this.onUnhandledActivityType(innerDc);
                    break;
                }
            }
        }
        if (innerDc.activeDialog == null)
        {
            // If the inner dialog stack completed during this turn, this component should be ended.
            return await innerDc.endDialog();
        }

        return Dialog.EndOfTurn;
    }