Struct glitch_in_the_matrix::MatrixClient [] [src]

pub struct MatrixClient { /* fields omitted */ }

A connection to a Matrix homeserver.

Methods

impl MatrixClient
[src]

Log in to a Matrix homeserver, and return a client object.

Join a room by identifier or alias.

Update our presence status.

Send a read receipt for a given event ID.

Send a message to a room ID.

Wrapper function that sends a Message::Notice with the specified unformatted text to the given room ID. Provided for convenience purposes.

Wrapper function that sends a Message::Notice with the specified HTML-formatted text (and accompanying unformatted text, if given) to the given room ID.

Get the client's MXID.

Set whether polling the sync API marks us as online.

Ascertain whether polling the sync API marks us as online.

Poll the Matrix server for new events since the last call to sync().

It is recommended to call this in a loop. The Matrix server will block until new events arrive, up to a given timeout value.

Make an arbitrary HTTP request to the Matrix API.

  • /_matrix/client/r0 is filled in for you, so your endpoint is something like /sync.
  • params is a list of key=value HTTP parameters, like timeout=30.

Returns a RequestBuilder which you can use for your own nefarious ends.

Trait Implementations

impl Drop for MatrixClient
[src]

Invalidates our access token, so we don't have millions of devices. Also sets us as offline.