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

Support image and file messages #86

Closed
lprintf opened this issue Jul 27, 2021 · 3 comments
Closed

Support image and file messages #86

lprintf opened this issue Jul 27, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@lprintf
Copy link
Contributor

lprintf commented Jul 27, 2021

We support image and file messages by upload files to matrix mainly through the api. For image message, setting the file type option as image when upload file can ensure it show as image in elements.

@lprintf
Copy link
Contributor Author

lprintf commented Jul 27, 2021

appservice-manager.sendMessage() is a method to deel with the wechaty messages from wechat(actually could be other apps).
We use intent.uploadContent(ref the api) to upload image or file messages, and intent.sendMessage(ref the ture actions of matrix showed in element source code when we send though element.

matrix-handler.superEvent2Message is a method to deel with the messages from matrix.
We use appserviceManager.mxcUrlToHttp to get the https urls of the source file, if the message is images or attachments, and convert its to fileboxs and send its to wechat.

@huan
Copy link
Member

huan commented Jul 28, 2021

@545641826 The PR has been merged and I believe it will publish a new version of the NPM and Docker image soon.

Please link your future issues to our OSPP'21 project issue at wechaty/summer#59 so that we can see all changes in the OSPP main issue.

Could you please also add your changes to the History section in the README.md so that we can track the version changes?

Thank you very much.

@lprintf
Copy link
Contributor Author

lprintf commented Jul 28, 2021

OK, I have finished the above requirements.

@lprintf lprintf closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants