(#x3lil7q) Inpsired by function ExpandMentions in https://github.com/jdtron/twet and settings hooks.[pre|post] on config.yaml, I created function ExpandInlineFiles and added media.folder and media.url to config.yaml.
#uutzeya
(#x3lil7q) The media.folder is a valid scp path (server:/path/to/media_folder) and media.url preffix for each media link (https://txtxt.server.net/media).
#ntak4ia
(#x3lil7q) The funtion ExpandInlineFiles turns ‘{i}/path/to/filename.jpg’ into ‘![filename](https://twtxt.site.net/media/filenamehash.jpg)’: uses scp to upload /path/to/filename.jpg to remote folder specified by media.folder, renaming it to a hash string based on filename, filenamehash; and concatenates the value of media.url with filenamehash.
#hmrqfxq
(#x3lil7q) I’ll file a merge request to twet team.
#hxsut6q