Struct glitch_in_the_matrix::room::RoomClient [] [src]

pub struct RoomClient<'a, 'b: 'a, 'c> {
    pub room: &'a Room<'b>,
    pub cli: &'c mut MatrixClient,
}

A Room with a MatrixClient, which you can use to call endpoints relating to rooms.

Fields

Methods

impl<'a, 'b, 'c> RoomClient<'a, 'b, 'c>
[src]

[src]

Sends a message to this room.

[src]

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

[src]

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

[src]

Send a read receipt for a given event ID.

[src]

Looks up the contents of a state event with type ev_type and state key key in a room. If the user is joined to the room then the state is taken from the current state of the room. If the user has left the room then the state is taken from the state of the room when they left.

The return value here can be any object that implements Deserialize, allowing you to use the state API to store arbitrary objects. Common state events, such as m.room.name, can be found in the content module (content::room::Name for m.room.name).

If the event was not found, an error will be thrown of type HttpCode(http::StatusCode::NotFound).

[src]

State events can be sent using this endpoint. These events will be overwritten if the (ev_type) and (key) all match.

Like get_state, the value here can be any object that implements Serialize, allowing you to use the state API to store arbitrary objects. See the get_state docs for more.

[src]

Strips all information out of an event which isn't critical to the integrity of the server-side representation of the room.

This cannot be undone.

Users may redact their own events, and any user with a power level greater than or equal to the redact power level of the room may redact events there.

[src]

This tells the server that the user is typing for the next N milliseconds where N is the value specified in the timeout key. Alternatively, if typing is false, it tells the server that the user has stopped typing.

[src]

This API starts a user participating in a particular room, if that user is allowed to participate in that room. After this call, the client is allowed to see all current state events in the room, and all subsequent events associated with the room until the user leaves the room.

After a user has joined a room, the room will appear as an entry in the values in the SyncStream.

[src]

This API stops a user participating in a particular room.

If the user was already in the room, they will no longer be able to see new events in the room. If the room requires an invite to join, they will need to be re-invited before they can re-join.

If the user was invited to the room, but had not joined, this call serves to reject the invite.

The user will still be allowed to retrieve history from the room which they were previously allowed to see.

[src]

This API stops a user remembering about a particular room.

In general, history is a first class citizen in Matrix. After this API is called, however, a user will no longer be able to retrieve history for this room. If all users on a homeserver forget a room, the room is eligible for deletion from that homeserver.

If the user is currently joined to the room, they will implicitly leave the room as part of this API call.

[src]

Kick a user from the room.

The caller must have the required power level in order to perform this operation.

[src]

Ban a user in the room. If the user is currently in the room, also kick them.

When a user is banned from a room, they may not join it or be invited to it until they are unbanned.

The caller must have the required power level in order to perform this operation.

[src]

Unban a user from the room. This allows them to be invited to the room, and join if they would otherwise be allowed to join according to its join rules.

The caller must have the required power level in order to perform this operation.

[src]

This API invites a user to participate in a particular room. They do not start participating in the room until they actually join the room.

Only users currently in a particular room can invite other users to join that room.

If the user was invited to the room, the homeserver will append a m.room.member event to the room.

Note that there are two forms of this API, which are documented separately. This version of the API requires that the inviter knows the Matrix identifier of the invitee. The other is documented in the third party invites section of the Matrix spec, and is not implemented in Glitch in the Matrix (yet!)

[src]

Get a user's power level, falling back on the default value for the room if not present.

The user_id is a String here, not a &str, because it is stored in a future that outlives this function.