async-matrixSourceAsyncMatrixApplicationServiceServer

class Server

Rack 3 application implementing the Matrix Application Service API.

Routes: PUT /_matrix/app/v1/transactions/txnId — receive events from homeserver GET /_matrix/app/v1/users/userId — user existence query GET /_matrix/app/v1/rooms/roomAlias — room alias query POST /_matrix/app/v1/ping — healthcheck

Definitions

def register(handler)

Register a Bot or a plain handler on the internal dispatcher.

Accepts either:

  • A Bot (responds to #handlers) — registers all its handlers
  • A plain handler (responds to #event_types and #call)

Implementation

def register(handler)
  if handler.respond_to?(:handlers)
    handler.handlers.each { |h| @dispatcher.register(h) }
  else
    @dispatcher.register(handler)
  end
end