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

[FR] Resent the incoming photo as a file #132

Open
QieSen opened this issue Feb 11, 2023 · 2 comments
Open

[FR] Resent the incoming photo as a file #132

QieSen opened this issue Feb 11, 2023 · 2 comments

Comments

@QieSen
Copy link

QieSen commented Feb 11, 2023

When the flag send_image_as_file is false, users reply to an incoming photo message with /resent command, ETM will reply to the selected message (Easy to trace back), then resent that photo as a file to the session. Or return an error if the message id got invalid due to EWS session refresh.

When the flag is true, ETM should ignore the /resent command, or return a error.

当ETM属性 send_image_as_file 为false时响应 /resent 指令,用户发送指令回复一条bot转发的图片消息,ETM会引用该消息(方便回溯定位)并将该图片以文件形式重新发到会话中。若EWS会话刷新导致该消息id失效则返回报错。
若上述ETM属性为true则不响应 /resent 命令或返回错误。

@blueset
Copy link
Member

blueset commented Feb 12, 2023

I like the idea. However, unfortunately, EWS did not implement get_message_by_id() due to the corresponding API from Web WC not made available to us. This means that we have no way to download the message again by ID. If we are to implement the feature, we would need to store all images locally, which could increase the demand of the users’ storage space.

Please let me know if you have any idea to workaround this.

我喜欢这个想法。但遗憾的是 EWS 没有实现 get_message_by_id() 这个方法。因为网页版 WC 没有暴露的相应接口出来,EWS 没有办法按照消息 ID 重新下载消息。如果要实现这个功能,EWS 可能需要在本地存储所有的图片,且会增加用户存储空间的需求。

如果您有其他更好的办法,欢迎留言讨论。

@QieSen QieSen changed the title [FR] Recent the incoming photo as a file [FR] Resent the incoming photo as a file Feb 13, 2023
@QieSen
Copy link
Author

QieSen commented Feb 14, 2023

Thanks for your answer.
After testing with Web WC, I found that even if the cache is disabled, the pictures can be downloaded repeatedly in quite a long time.

Besides, both reply /rm and delete_on_edit feature can make EWS locate a message then revoke it. Is there any way of modifying them to locate the picture and re-download it?

感谢你的解答。
我发现在网页版微信中,即使禁用缓存,很长一段时间内聊天中的图片仍然可以反复下载。

另外,既然ETM的/rm撤回和EWS的delete_on_edit特性都可以让EWS定位到对应的历史消息,或许对撤回功能加以修改就能够实现定位并重新下载图片?

以上是我的一些看法,由于我对于代码层面的理解很浅显,如有错误请指出。

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

No branches or pull requests

2 participants