diff options
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; } |