matridge.command
================

.. py:module:: matridge.command


Classes
-------

.. autoapisummary::

   matridge.command.ListSpaces
   matridge.command.ManageTrust


Module Contents
---------------

.. py:class:: ListSpaces(xmpp)

   Bases: :py:obj:`slidge.command.Command`


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


   .. py:attribute:: NAME
      :value: '🌌 Matrix spaces'


      Friendly name of the command, eg: "do something with stuff"



   .. py:attribute:: CATEGORY

      If used, the command will be under this top-level category.
      Use the same string for several commands to group them.
      This hierarchy only used for the adhoc interface, not the chat command
      interface.



   .. py:attribute:: HELP
      :value: "List the matrix spaces you're part of"


      Long description of what the command does



   .. py:attribute:: ACCESS

      Who can use this command



   .. py:method:: run(session, _ifrom, *args)
      :async:


      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

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



   .. py:method:: finish(form_values, session, _ifrom, rooms)
      :staticmethod:

      :async:



.. py:class:: ManageTrust(xmpp)

   Bases: :py:obj:`slidge.command.Command`


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


   .. py:attribute:: NAME
      :value: '🤝 Manage trust in devices'


      Friendly name of the command, eg: "do something with stuff"



   .. py:attribute:: CATEGORY

      If used, the command will be under this top-level category.
      Use the same string for several commands to group them.
      This hierarchy only used for the adhoc interface, not the chat command
      interface.



   .. py:attribute:: HELP
      :value: 'Manage which OLM keys you trust or not.'


      Long description of what the command does



   .. py:attribute:: ACCESS

      Who can use this command



   .. py:attribute:: HUMAN_STATES


   .. py:method:: __human_device(d, state=True)


   .. py:method:: run(session, _ifrom, *args)
      :async:


      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

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



   .. py:method:: step2(form_values, session, _ifrom, devices)
      :async:



