matridge.command

Module Contents

Classes

ListSpaces

Abstract base class to implement gateway commands (chatbot and ad-hoc)

ManageTrust

Abstract base class to implement gateway commands (chatbot and ad-hoc)

class matridge.command.ListSpaces(xmpp)[source]

Bases: slidge.command.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway)

NAME = 'Matrix spaces'[source]
HELP = "List the matrix spaces you're part of"[source]
ACCESS[source]
async run(session, _ifrom, *args)[source]

Entry point of the command

Parameters:
  • session (matridge.session.Session) – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args (str) – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

Return type:

slidge.command.Form

async static finish(form_values, session, _ifrom, rooms)[source]
Parameters:
class matridge.command.ManageTrust(xmpp)[source]

Bases: slidge.command.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway)

NAME = 'Manage trust'[source]
HELP = 'Manage which OLM keys you trust or not.'[source]
ACCESS[source]
HUMAN_STATES[source]
__human_device(d, state=True)[source]
Parameters:

d (nio.crypto.OlmDevice)

async run(session, _ifrom, *args)[source]

Entry point of the command

Parameters:
  • session (matridge.session.Session) – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args (str) – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

Return type:

Union[slidge.command.Form, str]

async step2(form_values, session, _ifrom, devices)[source]
Parameters: