Create an instance of SimpleMatrixClient.
The URL of the Matrix server to login
Optional. The Matrix server URL for a logged in session.
Optional. The Matrix identity server URL for a logged in session.
Optional. The access key for a logged in session.
Optional. The Matrix user ID for a logged in session.
Optional. The default poll time in milliseconds to poll changes from upstream Matrix server.
Optional. The default wait time between polls, in milliseconds.
Private Readonly _accessPrivate Readonly _homePrivate Readonly _identityPrivate _initPrivate _nextPrivate Readonly _observerPrivate Readonly _originalPrivate _statePrivate _stopPrivate Readonly _syncPrivate Readonly _syncPrivate _syncPrivate Readonly _syncPrivate _userStatic EventPrivate _clearPrivate _clearPrivate _getPrivate _initPrivate
The state must be AUTHENTICATED to call this method.
While this method is executing the state will be AUTHENTICATED_AND_STARTING.
This method controls state change to:
Private _normalizePrivate _onPrivate _onPrivate _postPrivate _putPrivate _retryPrivate _setPrivate _startPrivate _startStart the long polling event listener from Matrix server.
The state SHOULD be AUTHENTICATED.
Nothing is done if the state is AUTHENTICATED_AND_STARTING, AUTHENTICATED_AND_RESTARTING, AUTHENTICATED_AND_STARTED or AUTHENTICATED_AND_SYNCING -- except if stop request has been scheduled, which will be cancelled.
The state must not be UNAUTHENTICATED or AUTHENTICATING.
@FIXME: This could be started automatically from listeners in our own observer. If so, this method could be changed to private later.
Stops the internal long polling loop against the Matrix server.
State should be AUTHENTICATED_AND_STARTED.
Will schedule stop later if state is AUTHENTICATED_AND_STARTING, AUTHENTICATED_AND_RESTARTING or AUTHENTICATED_AND_SYNCING.
Will not do anything (but warning) if state is UNAUTHENTICATED, AUTHENTICATING or AUTHENTICATED.
@FIXME: This could be stopped automatically when listeners are removed from our own observer. If so, this method could be changed to private later.
Private _syncPrivate
The state MUST be AUTHENTICATED_AND_STARTED to call this method.
While this method is executing the state will be AUTHENTICATED_AND_SYNCING.
It will result in a state:
Private _syncPrivate _triggerPrivate _triggerPrivate _triggerAuthenticate to the Matrix server using access key
New instance of SimpleMatrixClient which is initialized in to the authenticated state
The Matrix access key
Create a room.
Returns joined members from the homeserver
Returns a room state value of tuple roomId,eventType,StateKey.
Returns the current state of the client instance.
Join to a room.
Log in to the matrix server
New instance of SimpleMatrixClient which is initialized in to the authenticated state
The Matrix user ID to log into
The Matrix user password
Start listening some events.
Optional accessToken: stringThis call requires correctly configured Synapse and a shared secret code.
See SynapseUtils.createRegisterDTO(...) and .getRegisterNonce() to create a DTO.
Note, it requires NodeJS crypto module.
https://matrix-org.github.io/synapse/latest/admin_api/register_api.html
Sets room state value of tuple roomId,eventType,StateKey
Create the sync request.
Note! This is the raw method for the Matrix HTTP request, and is not related to the internal sync states.
Optional filter?: string | JsonObjectOptional full_Optional set_Optional since?: stringOptional timeout?: numberOptional. The default is 30 seconds.
Optional. If true, events from the first sync call are triggered.
Static Private _getStatic Private _normalizeStatic setGenerated using TypeDoc
Super lightweight Matrix client and simple event listener.
Far from perfect, but works both on browser and on OpenWRT with NodeJS 8 and full POC takes only 50k as compiled single bundle file (including all the dependencies) :)