From 62d736622a2814c1b090d39a73fb738ea59afadd Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:46:38 +0530 Subject: [PATCH] Set TeamsNotifyUser alert to opposite of alert_in_meeting (#2185) Co-authored-by: tracyboehrer --- .../core/teams/teams_activity_extensions.py | 2 +- .../tests/teams/test_teams_extension.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py index e604cb088..253b31f5c 100644 --- a/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py +++ b/libraries/botbuilder-core/botbuilder/core/teams/teams_activity_extensions.py @@ -71,7 +71,7 @@ def teams_notify_user( activity.channel_data = {} channel_data = TeamsChannelData().deserialize(activity.channel_data) - channel_data.notification = NotificationInfo(alert=True) + channel_data.notification = NotificationInfo(alert=not alert_in_meeting) channel_data.notification.alert_in_meeting = alert_in_meeting channel_data.notification.external_resource_url = external_resource_url activity.channel_data = channel_data diff --git a/libraries/botbuilder-core/tests/teams/test_teams_extension.py b/libraries/botbuilder-core/tests/teams/test_teams_extension.py index 1d2520bc4..406d3cb39 100644 --- a/libraries/botbuilder-core/tests/teams/test_teams_extension.py +++ b/libraries/botbuilder-core/tests/teams/test_teams_extension.py @@ -155,6 +155,17 @@ def test_teams_notify_user(self): # Assert assert activity.channel_data.notification.alert + def test_teams_notify_user_alert_in_meeting(self): + # Arrange + activity = Activity() + + # Act + teams_notify_user(activity, alert_in_meeting=True) + + # Assert + assert activity.channel_data.notification.alert_in_meeting is True + assert activity.channel_data.notification.alert is False + def test_teams_notify_user_with_no_activity(self): # Arrange activity = None