high-level Client-Server API over HTTP.
More...
#include <http_client.hh>
|
| HTTPClient (HTTP::Adapter &adapter, const std::string &server) |
|
void | login (const std::string &username, const std::string &password, const callback_t< const std::string &, const std::string &> &callback=noop_callback< const std::string &, const std::string &>) |
| log in using username and password More...
|
|
void | loginWith3PID (const std::string &medium, const std::string &address, const std::string &password, const callback_t< const std::string &, const std::string &> &callback=noop_callback< const std::string &, const std::string &>) |
| log in using third party ID and pasword. More...
|
|
void | loginWithToken (const std::string &token) |
|
void | logout (const callback_t<> &callback=noop_callback<>) |
| log out. More...
|
|
bool | isLoggedIn () const |
| determine if the client is currently logged in.
|
|
void | startClient () |
| start listening for new events.
|
|
void | stopClient () |
| stop listening for new events.
|
|
void | sendMessage (const Event::MessageEvent &, const callback_t< const std::string &> &=noop_callback< const std::string &>) |
| send a message event. More...
|
|
Room & | getRoom (const std::string &room_id) |
| return the room with the given ID. More...
|
|
const Room & | getRoom (const std::string &room_id) const throw (std::out_of_range) |
|
Room & | operator[] (const std::string &room_id) |
|
const Room & | operator[] (const std::string &room_id) const throw (std::out_of_range) |
|
void | on (const std::string &type, const callback_t< Room &, const Event::Event &> &callback) |
| register an event handler. More...
|
|
template<class T > |
void | on (const callback_t< Room &, const Event::Event &> &callback) |
| register an event handler. More...
|
|
|
void | trigger (const Event::Event &event) |
| call event handlers for the given event.
|
|
void | triggerError (const std::string &event_type, std::shared_ptr< Error::Error > error, const std::string &room_id="") |
|
void | _setRoomMembership (Room &room, Event::RoomMembership::membership_t membership) |
|
◆ login()
void HTTPClient::login |
( |
const std::string & |
username, |
|
|
const std::string & |
password, |
|
|
const callback_t< const std::string &, const std::string &> & |
= noop_callback< const std::string &, const std::string &> |
|
) |
| |
|
virtual |
log in using username and password
- Parameters
-
[in] | username | The username to log in as |
[in] | password | The password to use |
[out] | callback | The callback will receive the user's Matrix ID and the server name |
- See also
- (C-S r0.2.0 section 3.2.1)
Implements Operator::Client::Client.
- Examples:
- liboperator-glib/examples/echo.cc.
◆ loginWith3PID()
void HTTPClient::loginWith3PID |
( |
const std::string & |
medium, |
|
|
const std::string & |
address, |
|
|
const std::string & |
password, |
|
|
const callback_t< const std::string &, const std::string &> & |
= noop_callback< const std::string &, const std::string &> |
|
) |
| |
|
virtual |
◆ logout()
void HTTPClient::logout |
( |
const callback_t<> & |
= noop_callback<> | ) |
|
|
virtual |
◆ sendMessage()
void HTTPClient::sendMessage |
( |
const Event::MessageEvent & |
message, |
|
|
const callback_t< const std::string &> & |
callback = noop_callback< const std::string &> |
|
) |
| |
|
virtual |
send a message event.
- Parameters
-
[in] | message | The message event to send. |
[out] | callback | The callback will receive the resulting event ID. |
Implements Operator::Client::Client.
The documentation for this class was generated from the following files: