Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Nov 8, 2023
1 parent 582d664 commit 23a9452
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ public class PetStoreAssistantBot extends ActivityHandler {

private UserState userState;

public PetStoreAssistantBot(UserState userState) {
this.userState = userState;
public PetStoreAssistantBot(UserState withUserState) {
this.userState = withUserState;
}

// onTurn processing, with saving of state after each turn.
@Override
public CompletableFuture<Void> onTurn(TurnContext turnContext) {
return super.onTurn(turnContext)
.thenCompose(saveResult -> userState.saveChanges(turnContext));
}

@Override
Expand All @@ -68,7 +75,7 @@ protected CompletableFuture<Void> onMessageActivity(TurnContext turnContext) {
String sessionID = sessionIDProperty.get(turnContext).join();
String csrfToken = csrfTokenProperty.get(turnContext).join();

LOGGER.info("session: " + sessionID + " csrf: " + csrfToken);
LOGGER.info("found session: " + sessionID + " and csrf: " + csrfToken);

// strip out session id and csrf token if one was passed from soul machines sendTextMessage() function
AzurePetStoreSessionInfo azurePetStoreSessionInfo = PetStoreAssistantUtilities.getAzurePetStoreSessionInfo(text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static AzurePetStoreSessionInfo getAzurePetStoreSessionInfo(String text)
azurePetStoreSessionInfo = new AzurePetStoreSessionInfo(sessionID, csrfToken, newText);
LOGGER.info("Found session id:" + sessionID + " and csrf token:" + csrfToken + " in text: " + text + " new text: " + newText);
} else {
LOGGER.info("No session id or csrf token found in text: " + text);
LOGGER.info("No new session id or csrf token found in text: " + text);
}

return azurePetStoreSessionInfo;
Expand Down

0 comments on commit 23a9452

Please sign in to comment.