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

Spring bot support file upload feature in MS Teams app #445

Open
vaibhav-db opened this issue Sep 25, 2024 · 4 comments
Open

Spring bot support file upload feature in MS Teams app #445

vaibhav-db opened this issue Sep 25, 2024 · 4 comments
Assignees

Comments

@vaibhav-db
Copy link
Contributor

vaibhav-db commented Sep 25, 2024

Support file upload feature in MS Teams app

Description of Problem:

User can upload files in MS Teams with App.

Potential Solutions:

Our goal is to land this upload file in @ChatReuest controller method

In framework we need to modify complete flow.
like MessageActivityHandler --> ActionConsumer --> ChatHandlerMapping --> @chatRequest

@vaibhav-db vaibhav-db self-assigned this Sep 25, 2024
@vaibhav-db
Copy link
Contributor Author

@robmoffat we will discuss on today meeting. I had also sent detail over mail, as i was not able to attached the images here.

@robmoffat
Copy link
Member

image003

@robmoffat
Copy link
Member

robmoffat commented Sep 25, 2024

How to get attachments into SimpleMessageAction:

  1. SimpleMessageAction would need to have attachments as another property.
  2. For Symphony, we'd add the attachments to SimpleMessageAction in PresentationMLHandler
  3. In Teams, MessageActivityHandler does the same job. So we need to exclude the HTML attachment (which is the message) and add the others to the SimpleMessageAction attachments property from (1)

@robmoffat
Copy link
Member

robmoffat commented Sep 25, 2024

How to get from SimpleMessageAction to controller parameters:

  1. You need a new Resolver factory, copy FormDataArgumentWorkflowResolverFactory for an example.
  2. You need match on the parameters, so we need to decide what type the controller will use to indicate an attachment. Might be best to create a class:
interface IncomingAttachment {

  String getName()

  InputStream getContents()

}
  1. In the controller, you'd have a method like:
respondToAttachments(IncomingAttachment one, IncomingAttachment two) 

-or-

respondToAttachments(List<IncomingAttachment> one) 
  1. The new resolver factory would match to this IncomingAttachment type, and create objects from the SimpleMessageAction to fill out the parameters.

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

No branches or pull requests

2 participants