Skip to content

Commit

Permalink
Set TeamsNotifyUser alert to opposite of alert_in_meeting (#2185)
Browse files Browse the repository at this point in the history
Co-authored-by: tracyboehrer <[email protected]>
  • Loading branch information
gandiddi and tracyboehrer authored Oct 30, 2024
1 parent a9298c8 commit 62d7366
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions libraries/botbuilder-core/tests/teams/test_teams_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 62d7366

Please sign in to comment.