Class

MatrixBridge

MatrixBridge()

Utility class for common operations performed by bridges (represented as appservices). The storage utilities are not intended for bridges which allow 1:many relationships with the remote network. Bridges are generally expected to create their own classes which extend the IRemoteRoomInfo and IRemoteUserInfo interfaces and serialize to JSON cleanly. The serialized version of these classes is persisted in various account data locations for future lookups.
Constructor

# new MatrixBridge()

View Source appservice/MatrixBridge.ts, line 19

Classes

MatrixBridge

Methods

# async getIntentForRemote(remoteUserId) → {Promise.<Intent>}

Gets a Matrix user intent for the provided remote user ID.
Parameters:
Name Type Description
remoteUserId string The remote user ID to look up.

View Source appservice/MatrixBridge.ts, line 194

Resolves to the Matrix user intent.
Promise.<Intent>

# async getMatrixRoomIdForRemote(remoteRoomId) → {Promise.<string>}

Gets the Matrix room ID for the provided remote room ID.
Parameters:
Name Type Description
remoteRoomId string The remote room ID to look up.

View Source appservice/MatrixBridge.ts, line 185

Resolves to the Matrix room ID.
Promise.<string>

# async getRemoteRoomInfo(matrixRoomId) → {Promise.<IRemoteRoomInfo>}

Gets information about a remote room.
Parameters:
Name Type Description
matrixRoomId string The Matrix room ID to get information on.

View Source appservice/MatrixBridge.ts, line 165

Resolves to the remote room information.
Promise.<IRemoteRoomInfo>

# async getRemoteUserInfo(userIntent) → {Promise.<IRemoteUserInfo>}

Gets information about a remote user.
Parameters:
Name Type Description
userIntent Intent The Matrix user intent to get information on.

View Source appservice/MatrixBridge.ts, line 145

Resolves to the remote user information.
Promise.<IRemoteUserInfo>

# async setRemoteRoomInfo(matrixRoomId, remoteInfo) → {Promise.<any>}

Sets information about a remote room. Calling this function will map the provided remote room ID to the matrix room ID.
Parameters:
Name Type Description
matrixRoomId string The Matrix room ID to store information on.
remoteInfo IRemoteRoomInfo The remote room information to store

View Source appservice/MatrixBridge.ts, line 176

Resolves when the information has been updated.
Promise.<any>

# async setRemoteUserInfo(userIntent, remoteInfo) → {Promise.<any>}

Sets information about a remote user. Calling this function will map the provided remote user ID to the intent's owner.
Parameters:
Name Type Description
userIntent Intent The Matrix user intent to store information on.
remoteInfo IRemoteUserInfo The remote user information to store

View Source appservice/MatrixBridge.ts, line 156

Resolves when the information has been updated.
Promise.<any>