Skip to content

Commit 3d841e1

Browse files
committed
Merge branch 'v-gandiddi/SharePoint-ACE-API' of https://github.com/Microsoft/botbuilder-python into v-gandiddi/SharePoint-ACE-API
2 parents f8f2c4a + 906c5f0 commit 3d841e1

File tree

6 files changed

+51
-5
lines changed

6 files changed

+51
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ We use the [@msbotframework](https://twitter.com/msbotframework) account on twit
118118
The [Gitter Channel](https://gitter.im/Microsoft/BotBuilder) provides a place where the Community can get together and collaborate.
119119

120120
## Contributing and our code of conduct
121-
We welcome contributions and suggestions. Please see our [contributing guidelines](./contributing.md) for more information.
121+
We welcome contributions and suggestions. Please see our [contributing guidelines](./Contributing.md) for more information.
122122

123123
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
124124

libraries/botbuilder-core/botbuilder/core/turn_context.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,13 @@ def remove_mention_text(activity: Activity, identifier: str) -> str:
396396
mentions = TurnContext.get_mentions(activity)
397397
for mention in mentions:
398398
if mention.additional_properties["mentioned"]["id"] == identifier:
399+
replace_text = (
400+
mention.additional_properties.get("text")
401+
or mention.additional_properties.get("mentioned")["name"]
402+
)
399403
mention_name_match = re.match(
400404
r"<at(.*)>(.*?)<\/at>",
401-
escape(mention.additional_properties["text"]),
405+
escape(replace_text),
402406
re.IGNORECASE,
403407
)
404408
if mention_name_match:

libraries/botbuilder-core/tests/test_turn_context.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,48 @@ def test_should_remove_at_mention_with_regex_characters(self):
350350
assert text == " test activity"
351351
assert activity.text == " test activity"
352352

353+
def test_should_remove_custom_mention_from_activity(self):
354+
activity = Activity(
355+
text="Hallo",
356+
text_format="plain",
357+
type="message",
358+
timestamp="2025-03-11T14:16:47.0093935Z",
359+
id="1741702606984",
360+
channel_id="msteams",
361+
service_url="https://smba.trafficmanager.net/emea/REDACTED/",
362+
from_property=ChannelAccount(
363+
id="29:1J-K4xVh-sLpdwQ-R5GkOZ_TB0W3ec_37p710aH8qe8bITA0zxdgIGc9l-MdDdkdE_jasSfNOeWXyyL1nsrHtBQ",
364+
name="",
365+
aad_object_id="REDACTED",
366+
),
367+
conversation=ConversationAccount(
368+
is_group=True,
369+
conversation_type="groupChat",
370+
tenant_id="REDACTED",
371+
id="19:Ql86tXNM2lTBXNKJdqKdwIF9ltGZwpvluLvnJdA0tmg1@thread.v2",
372+
),
373+
recipient=ChannelAccount(
374+
id="28:c5d5fb56-a1a4-4467-a7a3-1b37905498a0", name="Azure AI Agent"
375+
),
376+
entities=[
377+
Entity().deserialize(
378+
Mention(
379+
type="mention",
380+
mentioned=ChannelAccount(
381+
id="28:c5d5fb56-a1a4-4467-a7a3-1b37905498a0",
382+
name="Custom Agent",
383+
),
384+
).serialize()
385+
)
386+
],
387+
channel_data={"tenant": {"id": "REDACTED"}, "productContext": "COPILOT"},
388+
)
389+
390+
text = TurnContext.remove_mention_text(activity, activity.recipient.id)
391+
392+
assert text == "Hallo"
393+
assert activity.text == "Hallo"
394+
353395
async def test_should_send_a_trace_activity(self):
354396
context = TurnContext(SimpleAdapter(), ACTIVITY)
355397
called = False

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async def on_dialog_event(
125125

126126
# Bubble as needed
127127
if (not handled) and dialog_event.bubble and dialog_context.parent:
128-
handled = await dialog_context.parent.emit(
128+
handled = await dialog_context.parent.emit_event(
129129
dialog_event.name, dialog_event.value, True, False
130130
)
131131

libraries/botframework-connector/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ botbuilder-schema==4.17.0
33
requests==2.32.0
44
PyJWT==2.4.0
55
cryptography==43.0.1
6-
msal>=1.29.0
6+
msal>=1.31.1

libraries/botframework-connector/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# "requests>=2.23.0,<2.26",
1212
"PyJWT>=2.4.0",
1313
"botbuilder-schema==4.17.0",
14-
"msal>=1.29.0",
14+
"msal>=1.31.1",
1515
]
1616

1717
root = os.path.abspath(os.path.dirname(__file__))

0 commit comments

Comments
 (0)