diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Matrix.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp index 2e25d69..293b00a 100644 --- a/plugins/Matrix.hpp +++ b/plugins/Matrix.hpp @@ -495,6 +495,19 @@ namespace QuickMedia { MatrixRoomsPage *all_rooms_page; }; + class MatrixInviteUserPage : public Page { + public: + MatrixInviteUserPage(Program *program, Matrix *matrix, std::string room_id) : Page(program), matrix(matrix), room_id(std::move(room_id)) {} + const char* get_title() const override { return "Invite user"; } + bool search_is_filter() override { return false; } + SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + bool allow_submit_no_selection() const override { return true; } + private: + Matrix *matrix; + std::string room_id; + }; + class Matrix { public: // TODO: Make this return the Matrix object instead, to force users to call start_sync @@ -537,12 +550,15 @@ namespace QuickMedia { PluginResult set_read_marker(RoomData *room, const std::string &event_id, int64_t event_timestamp); - PluginResult join_room(const std::string &room_id); + PluginResult join_room(const std::string &room_id_or_name); PluginResult leave_room(const std::string &room_id); // If |since| is empty, then the first page is fetched PluginResult get_public_rooms(const std::string &server, const std::string &search_term, const std::string &since, BodyItems &rooms, std::string &next_batch); + PluginResult search_user(const std::string &search_term, unsigned int limit, BodyItems &result_items); + PluginResult invite_user(const std::string &room_id, const std::string &user_id); + // |message| is from |BodyItem.userdata| and is of type |Message*| bool was_message_posted_by_me(void *message); |