Skip to content

Conversation

@mdrichardson
Copy link
Contributor

@mdrichardson mdrichardson commented Jun 10, 2021

Fixes #5622
Fixes #5623

Description

Adds a GetMeetingInfo method to TeamsInfo.
Adds support to TeamsActivityHandler for meeting start/end events.

Notes

Bots implementing this must add this to their manifest.json:

"webApplicationInfo": {
        "id": "<MicrosoftAppId>",
        "resource": "<urlToApp>",
        "applicationPermissions": [
            "OnlineMeeting.ReadBasic.Chat"
        ]
    }

Testing

image

Note that somebody needs to actually start/join the meeting for this to work. The scheduled start/end times mean nothing for this event.
image

@mdrichardson mdrichardson marked this pull request as ready for review June 10, 2021 15:33
@mdrichardson mdrichardson requested a review from a team as a code owner June 10, 2021 15:33
@mdrichardson mdrichardson changed the title feat: add GetMeetingDetails support feat: add GetMeetingInfo support Jun 10, 2021
@mdrichardson mdrichardson marked this pull request as ready for review June 10, 2021 23:02
@mdrichardson mdrichardson changed the title feat: add GetMeetingInfo support feat: add GetMeetingInfo and meeting event support Jun 21, 2021
Comment on lines +768 to +795
/// <summary>
/// Invoked when a Teams Meeting Start event activity is received from the connector.
/// Override this in a derived class to provide logic for when a meeting is started.
/// </summary>
/// <param name="meeting">The details of the meeting.</param>
/// <param name="turnContext">A strongly-typed context object for this turn.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects
/// or threads to receive notice of cancellation.</param>
/// <returns>A task that represents the work queued to execute.</returns>
protected virtual Task OnTeamsMeetingStartAsync(MeetingStartEventDetails meeting, ITurnContext<IEventActivity> turnContext, CancellationToken cancellationToken)
{
return Task.CompletedTask;
}

/// <summary>
/// Invoked when a Teams Meeting End event activity is received from the connector.
/// Override this in a derived class to provide logic for when a meeting is ended.
/// </summary>
/// <param name="meeting">The details of the meeting.</param>
/// <param name="turnContext">A strongly-typed context object for this turn.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects
/// or threads to receive notice of cancellation.</param>
/// <returns>A task that represents the work queued to execute.</returns>
protected virtual Task OnTeamsMeetingEndAsync(MeetingEndEventDetails meeting, ITurnContext<IEventActivity> turnContext, CancellationToken cancellationToken)
{
return Task.CompletedTask;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: There's a couple of things I'm not sure about with these:

  1. Argument order. Some methods (like OnTeamsFileConsent) have turnContext first, while others (like OnTeamsChannelDeleted) have turnContext come after the method-specific arguments (like channelInfo and teamsInfo).
  2. Based on the other overrides and virtuals, it looks like not marking these methods as async is the right call. Just want to confirm.

@@ -0,0 +1,91 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Contributor Author

@mdrichardson mdrichardson Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The inheritance around these new classes/interfaces is based around how Teams sends different but similar payloads for GetMeetingDetails and the meeting start/end events.

See review comments (some marked as resolved) for the JS PR for previous discussion.

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.

Teams - meeting start/end events (C#) Teams - get meeting details (C#)

3 participants