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

Send teams message to a chat #657

Closed
vroesgen opened this issue Nov 25, 2021 · 11 comments
Closed

Send teams message to a chat #657

vroesgen opened this issue Nov 25, 2021 · 11 comments
Assignees
Labels
area: model 📐 Related to the core SDK models question Further information is requested

Comments

@vroesgen
Copy link

vroesgen commented Nov 25, 2021

Until now it is only possible to send teams message to a teams channel.

With Graph you can create a chat between users an send messages to it.
Are there any plans to make this possible with PnpCore?

regards to the great team!

@jansenbe jansenbe added the question Further information is requested label Nov 25, 2021
@jansenbe
Copy link
Contributor

Thanks for using PnP Core SDK @vroesgen and for providing feedback. We currently indeed don't offer that feature, but I do agree that our Teams component does require a review and inclusion of more features.

In the meanwhile you could consider directly integrating the needed features in your solution via our custom API call feature: see https://pnp.github.io/pnpcore/using-the-sdk/basics-customapirequests.html#making-a-custom-microsoft-graph-request for details. It's super simple to make additional Graph/REST api calls.

@MathijsVerbeeck
Copy link
Contributor

@jansenbe If possible I'd like to work on this issue.

@jansenbe
Copy link
Contributor

jansenbe commented Apr 6, 2022

You're on a roll @MathijsVerbeeck 💪

@jansenbe jansenbe added the area: model 📐 Related to the core SDK models label Apr 6, 2022
@MathijsVerbeeck
Copy link
Contributor

@jansenbe I find it hard to decide on where to add this code to the current structure. Most logically is writing it under the folder "Teams", but this is not really a call referring in Graph to the "teams/" api but it has its own api "chats/" for sending a message specifically to a certain user. Could you assist on deciding this?

@jansenbe
Copy link
Contributor

jansenbe commented Apr 6, 2022

@MathijsVerbeeck : what do you think about the following. Start with adding an IMe property on PnPContext:

/// <summary>
/// Entry point for the Me Object
/// </summary>
public IMe Me
{
    get
    {
        (me.Value as Me).PnPContext = this;
        return me.Value;
    }
}

IMe will then serve as an entry point for (Graph) user specific operations like sending a chat and future additions.

@MathijsVerbeeck
Copy link
Contributor

@jansenbe That would work for me, but I'm still stuck with the same question on where to place the new code. Should I create a new folder under sdk/PnP.Core/Model for these specific additions? I'm not yet 100% familiar with the current project structure / how far I can go with adding new implementations

@jansenbe
Copy link
Contributor

jansenbe commented Apr 6, 2022

Let's create /Model/Me/Chat and follow the same structure as the other folders (Internal + Public sub folders). In the Test project also create a folder Me and have a ChatTests.cs file for the test cases.

@MathijsVerbeeck

@MathijsVerbeeck
Copy link
Contributor

@jansenbe Fine for me. Thanks for the information.

@MathijsVerbeeck
Copy link
Contributor

@jansenbe A lot of code is already written under "Teams" e.g. Interface ITeamChatMessage can be reused to add a message to a private / group chat. Am I allowed to add a reference to these classes or should I recreate them under "Me"?

@jansenbe
Copy link
Contributor

jansenbe commented Apr 7, 2022

You can reuse those @MathijsVerbeeck

@jansenbe
Copy link
Contributor

@MathijsVerbeeck : Just merged your PR...excellent work again. Thanks a ton!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants