Skip to content

Port: Support Teams message edit, message soft delete, message undelete activities #2183

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

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

gandiddi
Copy link
Contributor

Fixes #minor

Description

This PR ports the changes from microsoft/botbuilder-dotnet#6564 to maintain parity with microsoft/botbuilder-dotnet.

This PR aims to extend the Bot SDK so that developers can consume newly added events that Teams will emit to the bot. They are:
TeamsMessageEdit - a user editing a message in Teams.
TeamsMessageUndelete - a user undo a deleted message in Teams.
TeamsMessageSoftDelete - a user soft deleting a message in Teams.

Specific Changes

  1. Extended ActivityHandler to handle MessageUpdate and MessageDelete activity types and dispatch functions for activity types.
  2. Extended TeamsActivityHandler to handle MessageUpdate (with subtypes TeamsMessageEdit and TeamsMessageUndelete) and MessageDelete (with subtype TeamsMessageSoftDelete) teams events.

ActivityHandler Class

  • Added on_message_update_activity method and on_message_delete_activity method

TeamsActivityHandler Class

  • Overrided the above two methods and add logic based to event_type
  • on_message_update_activity could call on_teams_message_edit or on_teams_message_undelete
  • on_message_delete_activity could call on_teams_message_soft_delete

Testing

The following images shows the related unit test passing.
testRes
image

@gandiddi gandiddi requested a review from a team as a code owner October 29, 2024 13:48
@gandiddi gandiddi requested a review from tracyboehrer October 29, 2024 15:44
@tracyboehrer tracyboehrer merged commit a74532b into main Oct 30, 2024
7 checks passed
@tracyboehrer tracyboehrer deleted the v-gandiddi/AddNewActivityTypes branch October 30, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants