diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-09-10 22:17:34 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-09-10 22:17:34 +0200 |
commit | 0ea083cbd4013cf2e709a3e3810ae96167585a74 (patch) | |
tree | 119f1fb52c94442d7d01d1a7992ac1a9f3b387a6 /plugins | |
parent | 1c150eeb1d530e19976c945e69410c0cf26a3cb0 (diff) |
Matrix: better name for clipboard file (with extension), give pantalaimon files proper filenames when downloading
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Matrix.hpp | 10 | ||||
-rw-r--r-- | plugins/Page.hpp | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 0c12831..45dd1f7 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -412,11 +412,14 @@ namespace QuickMedia { const std::string title; }; - // Dummy, only play one video. TODO: Play all videos in room, as related videos? + // Only play one video. TODO: Play all videos in room, as related videos? class MatrixVideoPage : public VideoPage { public: - MatrixVideoPage(Program *program) : VideoPage(program, "") {} + MatrixVideoPage(Program *program, std::string filename) : VideoPage(program, ""), filename(std::move(filename)) {} const char* get_title() const override { return ""; } + std::string get_filename() override { return filename; } + private: + std::string filename; }; class MatrixChatPage : public Page { @@ -543,7 +546,8 @@ namespace QuickMedia { // |relates_to| is from |BodyItem.userdata| and is of type |Message*| PluginResult post_reaction(RoomData *room, const std::string &body, void *relates_to, std::string &event_id_response); - PluginResult post_file(RoomData *room, const std::string &filepath, std::string &event_id_response, std::string &err_msg); + // If filename is empty then the filename is extracted from filepath + PluginResult post_file(RoomData *room, const std::string &filepath, std::string filename, std::string &event_id_response, std::string &err_msg); PluginResult login(const std::string &username, const std::string &password, const std::string &homeserver, std::string &err_msg); PluginResult logout(); diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 2fa2b6c..97b0340 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -184,6 +184,7 @@ namespace QuickMedia { virtual void mark_watched() {}; // Should not do any network request to not slow down video loading virtual void get_subtitles(SubtitleData &subtitle_data) { (void)subtitle_data; } + virtual std::string get_filename() { return ""; } virtual bool is_local() const { return false; } |