66 lines
2.3 KiB
C++
66 lines
2.3 KiB
C++
/**
|
|
This file is a part of rexy's matrix client
|
|
Copyright (C) 2019 rexy712
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef MATRIX_REST_CLIENT_URL_LIST_HPP
|
|
#define MATRIX_REST_CLIENT_URL_LIST_HPP
|
|
|
|
#include "matrix/session_info.hpp"
|
|
#include "raii/string.hpp"
|
|
#include "matrix/rest/urls_common.hpp"
|
|
|
|
namespace matrix::rest{
|
|
class client_url_list
|
|
{
|
|
private:
|
|
raii::string m_create_room;
|
|
raii::string m_file_upload;
|
|
raii::string m_room_list;
|
|
raii::string m_alias_lookup;
|
|
raii::string m_displayname;
|
|
raii::string m_profile_picture;
|
|
|
|
public:
|
|
client_url_list(void) = default;
|
|
client_url_list(const session_info&);
|
|
client_url_list(const client_url_list&) = default;
|
|
client_url_list(client_url_list&&) = default;
|
|
client_url_list& operator=(const client_url_list&) = default;
|
|
client_url_list& operator=(client_url_list&&) = default;
|
|
|
|
const raii::string& create_room(void)const;
|
|
const raii::string& file_upload(void)const;
|
|
const raii::string& room_list(void)const;
|
|
const raii::string& alias_lookup(void)const;
|
|
const raii::string& displayname(void)const;
|
|
const raii::string& profile_picture(void)const;
|
|
raii::string file_download(const session_info& session, const raii::string_base& mediaid);
|
|
raii::string file_thumbnail(const session_info& session, const raii::string_base& fileurl, int width, int height, const raii::string_base& method)const;
|
|
raii::string presence(const session_info& session, const raii::string_base& userid)const;
|
|
raii::string sync(const session_info& session, const raii::rjp_string& batch, const raii::string& timeout);
|
|
|
|
void repopulate(const session_info&);
|
|
void invalidate(void);
|
|
|
|
private:
|
|
static raii::string get_server_media_string(const raii::string_base& url);
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|