Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Support Teams message edit, message soft delete, message undelete activities#6564

Merged
tracyboehrer merged 1 commit into
mainfrom
yingdu/eventsToBotChangeBoth
Nov 30, 2022
Merged

Support Teams message edit, message soft delete, message undelete activities#6564
tracyboehrer merged 1 commit into
mainfrom
yingdu/eventsToBotChangeBoth

Conversation

@yingduyingdu

@yingduyingdu yingduyingdu commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

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.

closes: https://github.com/microsoft/botbuilder-dotnet/issues/6565

Description

Extended ActivityHandler to handle MessageUpdate and MessageDelete activity types and dispatch functions for activity types.

Extended TeamsActivityHandler to handle MessageUpdate (with subtypes TeamsMessageEdit and TeamsMessageUndelete) and MessageDelete (with subtype TeamsMessageSoftDelete) teams events.

Specific Changes

ActivityHandler Class

  • Added OnMessageUpdateActivityAsync method and OnMessageDeleteActivityAsync method

TeamsActivityHandler Class

  • Overrided the above two methods and add logic based to eventType
  • OnMessageUpdateActivityAsync could call OnTeamsMessageEditAsync or OnTeamsMessageUndeleteAsync
  • OnMessageDeleteActivityAsync could call OnTeamsMessageSoftDeleteAsync

Testing

In ActivityHandlerTest class, added the following 2 unit tests

  • TestMessageUpdateActivity
  • TestMessageDeleteActivity

In TeamsActivityHandlerTests class, added the following 3 unit tests

  • TestMessageUpdateActivityTeamsMessageEdit
  • TestMessageUpdateActivityTeamsMessageUndelete
  • TestMessageDeleteActivityTeamsMessageSoftDelete

@yingduyingdu yingduyingdu requested a review from a team as a code owner November 29, 2022 21:21
@tracyboehrer tracyboehrer added the Automation: No parity PR does not need to be applied to other languages. label Nov 29, 2022
@coveralls

coveralls commented Nov 29, 2022

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 331361

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 33 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.04%) to 79.102%

Files with Coverage Reduction New Missed Lines %
/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/ServiceCollectionExtensions.cs 1 93.55%
/libraries/AdaptiveExpressions/BuiltinFunctions/StringTransformEvaluator.cs 1 83.33%
/libraries/Microsoft.Bot.Builder.LanguageGeneration/Evaluator.cs 1 95.42%
/libraries/Microsoft.Bot.Builder/Teams/TeamsActivityHandler.cs 3 78.23%
/libraries/Microsoft.Bot.Builder/ActivityHandler.cs 27 81.94%
Totals Coverage Status
Change from base Build 329938: 0.04%
Covered Lines: 25732
Relevant Lines: 32530

💛 - Coveralls

@yingduyingdu yingduyingdu self-assigned this Nov 29, 2022
@yingduyingdu

yingduyingdu commented Nov 29, 2022

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree [company="Microsoft"]

@yingduyingdu

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@yingduyingdu yingduyingdu force-pushed the yingdu/eventsToBotChangeBoth branch from e0704f4 to f217a67 Compare November 29, 2022 23:20
@BruceHaley

Copy link
Copy Markdown
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll

@tracyboehrer tracyboehrer merged commit c60d012 into main Nov 30, 2022
@tracyboehrer tracyboehrer deleted the yingdu/eventsToBotChangeBoth branch November 30, 2022 22:44
This was referenced May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Automation: No parity PR does not need to be applied to other languages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Teams message update and message delete events

5 participants