Skip to content

Conversation

@yingduyingdu
Copy link
Contributor

@yingduyingdu yingduyingdu commented Nov 29, 2022

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: #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
Copy link
Collaborator

coveralls commented Nov 29, 2022

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
Copy link
Contributor Author

yingduyingdu commented Nov 29, 2022

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

@yingduyingdu
Copy link
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
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

6 participants