aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-26 17:35:52 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-26 17:35:52 +0200
commita6bba48faa091932b5a51a3beb8c9d162c377adf (patch)
tree9b7e2de493e04e8eaf291f981f70d273b2dd7baf /plugins
parent9775a6bb77930a6e3b60445675990a8c01777aea (diff)
Matrix: add /join and /invite commands
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Matrix.hpp18
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);