Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port: Set TeamsNotifyUser alert to opposite of alert_in_meeting #2185

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading