10000 Provided impl for continue_conversation with ClaimsIdentity · itsmokha/botbuilder-python@0f32eef · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f32eef

Browse files
committed
Provided impl for continue_conversation with ClaimsIdentity
1 parent e141d08 commit 0f32eef

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_adapter.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,31 @@ async def continue_conversation(
138138
Sends a proactive message to a conversation. Call this method to proactively send a message to a conversation.
139139
Most _channels require a user to initiate a conversation with a bot before the bot can send activities
140140
to the user.
141-
:param bot_id: The application ID of the bot. This parameter is ignored in
142-
single tenant the Adpters (Console, Test, etc) but is critical to the BotFrameworkAdapter
143-
which is multi-tenant aware. </param>
144-
:param reference: A reference to the conversation to continue.</param>
145-
:param callback: The method to call for the resulting bot turn.</param>
146-
:param claims_identity:
141+
:param bot_id: Unused for this override.
142+
:param reference: A reference to the conversation to continue.
143+
:param callback: The method to call for the resulting bot turn.
144+
:param claims_identity: A ClaimsIdentity for the conversation.
145+
:param audience: Unused for this override.
147146
"""
148147

149148
if not reference:
150149
raise Exception("ConversationReference is required")
151150
if not callback:
152151
raise Exception("callback is required")
153152

154-
request = TurnContext.apply_conversation_reference(
155-
conversation_reference_extension.get_continuation_activity(reference),
156-
reference,
157-
)
158-
context = TurnContext(self, request)
153+
if claims_identity:
154+
request = conversation_reference_extension.get_continuation_activity(
155+
reference
156+
)
157+
context = TurnContext(self, request)
158+
context.turn_state[BotAdapter.BOT_IDENTITY_KEY] = claims_identity
159+
context.turn_state[BotAdapter.BOT_CALLBACK_HANDLER_KEY] = callback
160+
else:
161+
request = TurnContext.apply_conversation_reference(
162+
conversation_reference_extension.get_continuation_activity(reference),
163+
reference,
164+
)
165+
context = TurnContext(self, request)
159166

160167
return await self.run_pipeline(context, callback)
161168

0 commit comments

Comments
 (0)
0